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:
bors 2019-08-02 12:27:55 +00:00
commit 2f5ef735cf

View 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
}