2017-08-02 15:35:44 -07:00
|
|
|
// Validation makes this fail in the wrong place
|
2018-10-24 17:17:44 +02:00
|
|
|
// compile-flags: -Zmiri-disable-validation
|
2017-08-02 15:35:44 -07:00
|
|
|
|
2016-06-13 14:27:05 +02:00
|
|
|
#![feature(box_syntax)]
|
2016-06-13 12:29:01 +02:00
|
|
|
|
2016-08-27 01:44:46 -06:00
|
|
|
fn main() {
|
2016-06-30 21:33:24 -06:00
|
|
|
let x = box 42;
|
2016-06-13 12:29:01 +02:00
|
|
|
unsafe {
|
|
|
|
let f = std::mem::transmute::<Box<i32>, fn()>(x);
|
2020-03-08 23:34:54 +01:00
|
|
|
f() //~ ERROR function pointer but it does not point to a function
|
2016-06-13 12:29:01 +02:00
|
|
|
}
|
|
|
|
}
|