Auto merge of #874 - RalfJung:zst, r=RalfJung
test dangling ZST deref Fixes https://github.com/rust-lang/miri/issues/582.
This commit is contained in:
commit
2f5ef735cf
7
tests/compile-fail/dangling_zst_deref.rs
Normal file
7
tests/compile-fail/dangling_zst_deref.rs
Normal file
@ -0,0 +1,7 @@
|
||||
fn main() {
|
||||
let p = {
|
||||
let b = Box::new(42);
|
||||
&*b as *const i32 as *const ()
|
||||
};
|
||||
let _x = unsafe { *p }; //~ ERROR dangling pointer was dereferenced
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user