rust/tests/fail/alloc/stack_free.rs

11 lines
324 B
Rust
Raw Normal View History

// Validation/SB changes why we fail
// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows
2018-10-19 11:38:23 -05:00
2020-09-24 02:19:03 -05:00
// error-pattern: which is stack variable memory, using Rust heap deallocation operation
2017-07-13 12:10:14 -05:00
fn main() {
let x = 42;
let bad_box = unsafe { std::mem::transmute::<&i32, Box<i32>>(&x) };
2017-07-13 12:10:14 -05:00
drop(bad_box);
}