//@compile-flags: -Zmiri-strict-provenance // Taken from . use std::cell::Cell; fn helper(val: Box>, ptr: *const Cell) -> u8 { val.set(10); unsafe { (*ptr).set(20) }; //~ ERROR does not exist in the borrow stack val.get() } fn main() { let val: Box> = Box::new(Cell::new(25)); let ptr: *const Cell = &*val; let res = helper(val, ptr); assert_eq!(res, 20); }