rust/tests/compile-fail/cast_fn_ptr1.rs
2018-11-16 08:53:43 +01:00

10 lines
186 B
Rust

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