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
|
|
|
|
2017-06-21 21:54:42 -07:00
|
|
|
use std::mem;
|
|
|
|
|
|
|
|
fn f() {}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x : fn() = f;
|
|
|
|
let y : *mut u8 = unsafe { mem::transmute(x) };
|
|
|
|
let y = y.wrapping_offset(1);
|
|
|
|
let x : fn() = unsafe { mem::transmute(y) };
|
2020-03-08 23:34:54 +01:00
|
|
|
x(); //~ ERROR function pointer but it does not point to a function
|
2017-06-21 21:54:42 -07:00
|
|
|
}
|