rust/tests/compile-fail/stacked_borrows/issue-miri-1050-2.rs
2021-05-08 15:33:27 +08:00

8 lines
169 B
Rust

// error-pattern: 0x4 is not a valid pointer
use std::ptr::NonNull;
fn main() { unsafe {
let ptr = NonNull::<i32>::dangling();
Box::from_raw(ptr.as_ptr());
} }