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: null pointer is a dangling pointer
7 panic!("this should never print: {:?}", x);