rust/tests/compile-fail/cast_fn_ptr.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
159 B
Rust

fn main() {
fn f() {}
let g = unsafe {
std::mem::transmute::<fn(), fn(i32)>(f)
};
g(42) //~ ERROR tried to call a function of type
}