rust/tests/compile-fail/stacked_borrows/issue-miri-1050-2.rs
2020-03-19 08:25:08 +01:00

8 lines
172 B
Rust

// error-pattern: invalid use of 4 as a pointer
use std::ptr::NonNull;
fn main() { unsafe {
let ptr = NonNull::<i32>::dangling();
Box::from_raw(ptr.as_ptr());
} }