1 // This should fail even without validation, but some MIR opts mask the error
2 //@compile-flags: -Zmiri-disable-validation -Zmir-opt-level=0
4 unsafe fn make_ref<'a>(x: *mut i32) -> &'a mut i32 {
10 let x = make_ref(&mut 0); // The temporary storing "0" is deallocated at the ";"!
11 let val = *x; //~ ERROR: dereferenced after this allocation got freed