2017-08-02 17:35:44 -05:00
|
|
|
// Validation makes this fail in the wrong place
|
2018-10-24 10:17:44 -05:00
|
|
|
// compile-flags: -Zmiri-disable-validation
|
2017-08-02 17:35:44 -05:00
|
|
|
|
2016-06-13 07:27:05 -05:00
|
|
|
#![feature(box_syntax)]
|
2016-06-13 05:29:01 -05:00
|
|
|
|
2016-08-27 02:44:46 -05:00
|
|
|
fn main() {
|
2016-06-30 22:33:24 -05:00
|
|
|
let x = box 42;
|
2016-06-13 05:29:01 -05:00
|
|
|
unsafe {
|
|
|
|
let f = std::mem::transmute::<Box<i32>, fn()>(x);
|
2018-10-19 04:50:17 -05:00
|
|
|
f() //~ ERROR tried to treat a memory pointer as a function pointer
|
2016-06-13 05:29:01 -05:00
|
|
|
}
|
|
|
|
}
|