]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/fail/function_pointers/execute_memory.rs
Auto merge of #98483 - dvtkrlbs:bootstrap-dist, r=jyn514
[rust.git] / src / tools / miri / tests / fail / function_pointers / execute_memory.rs
1 // Validation makes this fail in the wrong place
2 //@compile-flags: -Zmiri-disable-validation
3
4 #![feature(box_syntax)]
5
6 fn main() {
7     let x = box 42;
8     unsafe {
9         let f = std::mem::transmute::<Box<i32>, fn()>(x);
10         f() //~ ERROR: function pointer but it does not point to a function
11     }
12 }