rust/tests/compile-fail/execute_memory.rs
Oliver Schneider ad053d66fe
change the block and stmt position after a function call returns
previously we moved to the target block *before* calling a function, so when inspecting
the stack, it appeared as if we were in the first statement of the next block.
2016-09-07 12:48:29 +02:00

10 lines
213 B
Rust

#![feature(box_syntax)]
fn main() {
let x = box 42;
unsafe {
let f = std::mem::transmute::<Box<i32>, fn()>(x);
f() //~ ERROR: tried to treat a memory pointer as a function pointer
}
}