Skip to content

Commit 2f5ef73

Browse files
committed
Auto merge of #874 - RalfJung:zst, r=RalfJung
test dangling ZST deref Fixes #582.
2 parents f0e8717 + 2973063 commit 2f5ef73

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)