]> git.lizzy.rs Git - rust.git/blob - tests/compile-fail/deref_fn_ptr.rs
Merge branch 'master' into hack_branch_for_miri_do_not_delete_until_merged
[rust.git] / tests / compile-fail / deref_fn_ptr.rs
1 fn f() {}
2
3 fn main() {
4     let x: i32 = unsafe {
5         *std::mem::transmute::<fn(), *const i32>(f) //~ ERROR constant evaluation error: tried to dereference a function pointer
6     };
7     panic!("this should never print: {}", x);
8 }