rust/tests/fail/stacked_borrows/issue-miri-1050-2.rs
2022-06-01 10:53:38 -04:00

8 lines
165 B
Rust

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