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

9 lines
198 B
Rust
Raw Normal View History

2021-07-15 13:33:08 -05:00
// error-pattern: pointer to 4 bytes starting at offset 0 is out-of-bounds
2019-11-14 03:23:29 -06:00
fn main() {
unsafe {
let ptr = Box::into_raw(Box::new(0u16));
Box::from_raw(ptr as *mut u32);
}
}