rust/tests/compile-fail-fullmir/stack_free.rs
2018-10-22 16:48:10 +02:00

11 lines
309 B
Rust

// 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
fn main() {
let x = 42;
let bad_box = unsafe { std::mem::transmute::<&i32, Box<i32>>(&x) };
drop(bad_box);
}