]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/fail/function_pointers/cast_fn_ptr4.rs
Merge commit '266e96785ab71834b917bf474f130a6d8fdecd4b' into sync_cg_clif-2022-10-23
[rust.git] / src / tools / miri / tests / fail / function_pointers / cast_fn_ptr4.rs
1 fn main() {
2     fn f(_: *const [i32]) {}
3
4     let g = unsafe { std::mem::transmute::<fn(*const [i32]), fn(*const i32)>(f) };
5
6     g(&42 as *const i32) //~ ERROR: calling a function with argument of type *const [i32] passing data of type *const i32
7 }