fn f() {}
fn main() {
- let x: i32 = unsafe {
- *std::mem::transmute::<fn(), *const i32>(f) //~ ERROR constant evaluation error [E0080]
- //~^ NOTE tried to dereference a function pointer
+ let x: u8 = unsafe {
+ *std::mem::transmute::<fn(), *const u8>(f) //~ ERROR contains a function
};
panic!("this should never print: {}", x);
}