mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 22:18:23 +03:00
11 lines
222 B
Rust
11 lines
222 B
Rust
#![feature(box_syntax)]
|
|
|
|
fn main() {
|
|
let x = box 42;
|
|
unsafe {
|
|
let f = std::mem::transmute::<Box<i32>, fn()>(x);
|
|
//~^ ERROR: tried to treat a memory pointer as a function pointer
|
|
f()
|
|
}
|
|
}
|