9 lines
184 B
Rust
Raw Normal View History

2016-06-13 12:29:01 +02:00
fn f() {}
fn main() {
let x: u8 = unsafe {
2020-03-08 23:34:54 +01:00
*std::mem::transmute::<fn(), *const u8>(f) //~ ERROR contains a function
};
panic!("this should never print: {}", x);
2016-06-13 12:29:01 +02:00
}