1 // Some optimizations remove ZST accesses, thus masking this UB.
2 // compile-flags: -Zmir-opt-level=0
4 #[allow(deref_nullptr)]
6 let x: () = unsafe { *std::ptr::null() }; //~ ERROR dereferencing pointer failed: 0x0 is not a valid pointer
7 panic!("this should never print: {:?}", x);