2016-06-13 07:27:05 -05:00
|
|
|
#![feature(box_syntax)]
|
2016-06-13 05:29:01 -05:00
|
|
|
|
2016-06-13 07:27:05 -05:00
|
|
|
fn main() {
|
2016-06-13 05:29:01 -05:00
|
|
|
//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()
|
|
|
|
}
|
|
|
|
}
|