rust/tests/compile-fail/stacked_borrows/issue-miri-1050-2.rs

8 lines
191 B
Rust
Raw Normal View History

2020-05-01 07:43:59 -05:00
// error-pattern: inbounds test failed: 0x4 is not a valid pointer
2019-11-14 03:23:29 -06:00
use std::ptr::NonNull;
fn main() { unsafe {
let ptr = NonNull::<i32>::dangling();
Box::from_raw(ptr.as_ptr());
} }