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