1 // Make sure we catch this even without validation
2 //@compile-flags: -Zmiri-disable-validation
4 // Make sure that we cannot load from memory a `&` that got already invalidated.
7 let xraw = x as *mut _;
8 let xref = unsafe { &*xraw };
9 let xref_in_mem = Box::new(xref);
10 unsafe { *xraw = 42 }; // unfreeze
11 let _val = *xref_in_mem; //~ ERROR: /retag .* tag does not exist in the borrow stack/