rust/tests/pass/cast_fn_ptr.rs
2022-06-20 15:39:46 -07:00

8 lines
146 B
Rust

fn main() {
fn f(_: *const u8) {}
let g = unsafe { std::mem::transmute::<fn(*const u8), fn(*const i32)>(f) };
g(&42 as *const _);
}