1 //@compile-flags: -Zmiri-strict-provenance
3 // Taken from <https://github.com/rust-lang/unsafe-code-guidelines/issues/194#issuecomment-520934222>.
7 fn helper(val: Box<Cell<u8>>, ptr: *const Cell<u8>) -> u8 {
9 unsafe { (*ptr).set(20) }; //~ ERROR: does not exist in the borrow stack
14 let val: Box<Cell<u8>> = Box::new(Cell::new(25));
15 let ptr: *const Cell<u8> = &*val;
16 let res = helper(val, ptr);