1 //@compile-flags: -Zmiri-permissive-provenance
6 let addr = root as *mut i32 as usize;
7 let exposed_ptr = addr as *mut i32;
8 // From the exposed ptr, we get a new SRO ptr.
9 let root2 = &*exposed_ptr;
10 // Stack: Unknown(<N), SRO(N), SRO(N+1)
11 // And we test that it is read-only by doing a conflicting write.
12 // (The write is still fine, using the `root as *mut i32` provenance which got exposed.)
15 let _val = *root2; //~ ERROR: /read access .* tag does not exist in the borrow stack/