]> git.lizzy.rs Git - rust.git/blob - tests/compile-fail/dangling_zst_deref.rs
adjust for error reform
[rust.git] / tests / compile-fail / dangling_zst_deref.rs
1 fn main() {
2     let p = {
3         let b = Box::new(42);
4         &*b as *const i32 as *const ()
5     };
6     let _x = unsafe { *p }; //~ ERROR dereferenced after this allocation got freed
7 }