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

7 lines
151 B
Rust
Raw Normal View History

2019-11-14 03:23:29 -06:00
// error-pattern: pointer must be in-bounds
fn main() { unsafe {
let ptr = Box::into_raw(Box::new(0u16));
Box::from_raw(ptr as *mut u32);
} }