]> git.lizzy.rs Git - rust.git/blob - tests/compile-fail/execute_memory.rs
make sure we show error messages even when we cannot show span
[rust.git] / tests / compile-fail / execute_memory.rs
1 // Validation makes this fail in the wrong place
2 // compile-flags: -Zmir-emit-validate=0
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 constant evaluation error
11         //~^ NOTE tried to treat a memory pointer as a function pointer
12     }
13 }