rust/tests/fail/stacked_borrows/issue-miri-1050-2.rs
2022-07-05 18:16:20 -04:00

10 lines
180 B
Rust

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