2016-06-13 12:29:01 +02:00
|
|
|
fn f() {}
|
|
|
|
|
2016-06-13 14:27:05 +02:00
|
|
|
fn main() {
|
2018-10-08 13:35:54 +02:00
|
|
|
let x: u8 = unsafe {
|
|
|
|
*std::mem::transmute::<fn(), *const u8>(f) //~ ERROR constant evaluation error: tried to dereference a function pointer
|
2016-06-13 14:27:05 +02:00
|
|
|
};
|
|
|
|
panic!("this should never print: {}", x);
|
2016-06-13 12:29:01 +02:00
|
|
|
}
|