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.
2 parents f0e8717 + 2973063 commit 2f5ef73Copy full SHA for 2f5ef73
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