]> git.lizzy.rs Git - rust.git/blob - tests/compile-fail/execute_memory.rs
2e6b58a753cd9d8f01eda654fba5a67664f53ba0
[rust.git] / tests / compile-fail / execute_memory.rs
1 // Validation makes this fail in the wrong place
2 // compile-flags: -Zmiri-disable-validation
3
4 #![feature(box_syntax)]
5
6 fn main() {
7     let x = box 42;
8     unsafe {
9         let f = std::mem::transmute::<Box<i32>, fn()>(x);
10         f() //~ ERROR function pointer but it does not point to a function
11     }
12 }