14 lines
354 B
Rust
14 lines
354 B
Rust
// Validation makes this fail in the wrong place
|
|
// compile-flags: -Zmir-emit-validate=0
|
|
|
|
#![feature(box_syntax)]
|
|
|
|
fn main() {
|
|
let x = box 42;
|
|
unsafe {
|
|
let f = std::mem::transmute::<Box<i32>, fn()>(x);
|
|
f() //~ ERROR constant evaluation error [E0080]
|
|
//~^ NOTE tried to treat a memory pointer as a function pointer
|
|
}
|
|
}
|