rust/tests/fail/function_pointers/cast_fn_ptr1.rs

8 lines
171 B
Rust
Raw Normal View History

2016-08-27 02:44:46 -05:00
fn main() {
fn f() {}
let g = unsafe { std::mem::transmute::<fn(), fn(i32)>(f) };
g(42) //~ ERROR: calling a function with more arguments than it expected
}