rust/tests/compile-fail/stack_free.rs
2017-08-01 09:56:21 +02:00

8 lines
208 B
Rust

// 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);
}