rust/tests/compile-fail-fullmir/stack_free.rs

11 lines
309 B
Rust
Raw Normal View History

2018-10-19 11:38:23 -05:00
// Validation changes why we fail
// compile-flags: -Zmir-emit-validate=0 -Zmiri-disable-validation
// error-pattern: tried to deallocate Stack memory but gave Machine(Rust) as the kind
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);
}