rust/tests/compile-fail/validity/execute_memory.rs

9 lines
175 B
Rust
Raw Normal View History

#![feature(box_syntax)]
fn main() {
let x = box 42;
unsafe {
2020-05-01 03:29:39 -05:00
let _f = std::mem::transmute::<Box<i32>, fn()>(x); //~ ERROR expected a function pointer
}
}