]> git.lizzy.rs Git - rust.git/blob - tests/compile-fail/cast_fn_ptr2.rs
39f0867489adca96d12ee0cde332c19d02de3158
[rust.git] / tests / compile-fail / cast_fn_ptr2.rs
1 fn main() {
2     fn f(_ : (i32,i32)) {}
3
4     let g = unsafe {
5         std::mem::transmute::<fn((i32,i32)), fn(i32)>(f)
6     };
7
8     g(42) //~ ERROR calling a function with argument of type (i32, i32) passing data of type i32
9 }