mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-23 04:57:37 +00:00
9 lines
207 B
Rust
9 lines
207 B
Rust
fn f() {}
|
|
|
|
fn main() {
|
|
let x: i32 = unsafe {
|
|
*std::mem::transmute::<fn(), *const i32>(f) //~ ERROR: tried to dereference a function pointer
|
|
};
|
|
panic!("this should never print: {}", x);
|
|
}
|