]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/fail/function_pointers/cast_int_to_fn_ptr.rs
Rollup merge of #102854 - semarie:openbsd-immutablestack, r=m-ou-se
[rust.git] / src / tools / miri / tests / fail / function_pointers / cast_int_to_fn_ptr.rs
1 // Validation makes this fail in the wrong place
2 //@compile-flags: -Zmiri-disable-validation
3
4 fn main() {
5     let g = unsafe { std::mem::transmute::<usize, fn(i32)>(42) };
6
7     g(42) //~ ERROR: is a dangling pointer
8 }