]> git.lizzy.rs Git - rust.git/blob - tests/compile-fail/execute_memory.rs
don't use `#[miri_run]` anymore, but execute the `main` function
[rust.git] / tests / compile-fail / execute_memory.rs
1 #![feature(box_syntax)]
2
3 fn main() {
4     //FIXME: this span is wrong
5     let x = box 42; //~ ERROR: tried to treat a memory pointer as a function pointer
6     unsafe {
7         let f = std::mem::transmute::<Box<i32>, fn()>(x);
8         f()
9     }
10 }