We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f0e8717 commit 2973063Copy full SHA for 2973063
tests/compile-fail/dangling_zst_deref.rs
@@ -0,0 +1,7 @@
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 dangling pointer was dereferenced
7
+}
0 commit comments