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