rust/tests/compile-fail/cast_fn_ptr1.rs
2020-03-19 08:41:01 +01:00

10 lines
182 B
Rust

fn main() {
fn f() {} //~ ERROR calling a function with more arguments than it expected
let g = unsafe {
std::mem::transmute::<fn(), fn(i32)>(f)
};
g(42)
}