Skip to content

Commit 190c12f

Browse files
committed
Auto merge of #118487 - RalfJung:exposed-provenance, r=thomcc
move exposed-provenance APIs into separate feature gate We have already stated explicitly for all the 'exposed' functions that > Using this method means that code is *not* following strict provenance rules. However, they were part of the same feature gate and still described as part of the strict provenance experiment. Unfortunately, their semantics are much less clear and certainly nowhere near stabilization, so in preparation for an attempt to stabilize the strict provenance APIs, I suggest we split the things related to "exposed" into their own feature gate. I also used this opportunity to better explain how Exposed Provenance fits into the larger plan here: this is *one possible candidate* for `as` semantics, but we don't know if it is actually viable, so we can't really promise that it is equivalent to `as`. If it works out we probably want to make `as` equivalent to the 'exposed' APIs; if it doesn't, we will remove them again and try to find some other semantics for `as`.
2 parents 9433d5b + cf3c868 commit 190c12f

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

tests/fail/provenance/ptr_int_unexposed.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@compile-flags: -Zmiri-permissive-provenance
2-
#![feature(strict_provenance)]
2+
#![feature(strict_provenance, exposed_provenance)]
33

44
fn main() {
55
let x: i32 = 3;

tests/fail/provenance/ptr_invalid.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(strict_provenance)]
1+
#![feature(strict_provenance, exposed_provenance)]
22

33
// Ensure that a `ptr::invalid` ptr is truly invalid.
44
fn main() {

tests/fail/provenance/strict_provenance_cast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@compile-flags: -Zmiri-strict-provenance
2-
#![feature(strict_provenance)]
2+
#![feature(exposed_provenance)]
33

44
fn main() {
55
let addr = &0 as *const i32 as usize;

tests/fail/stacked_borrows/exposed_only_ro.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@compile-flags: -Zmiri-permissive-provenance
2-
#![feature(strict_provenance)]
2+
#![feature(exposed_provenance)]
33

44
// If we have only exposed read-only pointers, doing a write through a wildcard ptr should fail.
55

tests/pass/ptr_int_from_exposed.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@revisions: stack tree
22
//@[tree]compile-flags: -Zmiri-tree-borrows
33
//@compile-flags: -Zmiri-permissive-provenance
4-
#![feature(strict_provenance)]
4+
#![feature(strict_provenance, exposed_provenance)]
55

66
use std::ptr;
77

tests/pass/stacked-borrows/int-to-ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@compile-flags: -Zmiri-permissive-provenance
2-
#![feature(strict_provenance)]
2+
#![feature(exposed_provenance)]
33
use std::ptr;
44

55
// Just to make sure that casting a ref to raw, to int and back to raw

tests/pass/stacked-borrows/unknown-bottom-gc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@compile-flags: -Zmiri-permissive-provenance
2-
#![feature(strict_provenance)]
2+
#![feature(exposed_provenance)]
33

44
use std::ptr;
55

0 commit comments

Comments
 (0)