blob: 7c5f440b774f2bb9b7d3b8cb0e7a63b9b50da16d [file] [log] [blame]
// Make sure we find these even with many checks disabled.
//@compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
fn main() {
let p = {
let b = Box::new(42);
&*b as *const i32
};
unsafe {
let _ = *p; //~ ERROR: dereferenced after this allocation got freed
}
panic!("this should never print");
}