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 `&mut` that got already invalidated.
7 let xraw = x as *mut _;
8 let xref = unsafe { &mut *xraw };
9 let xref_in_mem = Box::new(xref);
10 let _val = unsafe { *xraw }; // invalidate xref
11 let _val = *xref_in_mem; //~ ERROR: /retag .* tag does not exist in the borrow stack/