// compile-flags: -Zmiri-track-raw-pointers // Taken from . use std::cell::Cell; fn helper(val: Box>, ptr: *const Cell) -> u8 { val.set(10); unsafe { (*ptr).set(20); } //~ ERROR does not have an appropriate item 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); }