rust/tests/compile-fail/stacked_borrows/issue-miri-1050-1.rs
2021-07-16 10:10:12 +02:00

7 lines
182 B
Rust

// error-pattern: pointer to 4 bytes starting at offset 0 is out-of-bounds
fn main() { unsafe {
let ptr = Box::into_raw(Box::new(0u16));
Box::from_raw(ptr as *mut u32);
} }