about summary refs log tree commit diff
path: root/src/tools/miri/tests/fail/function_pointers/deref_fn_ptr.rs
blob: 3510f41361a0e49124b96103eb0cb057bd539566 (plain)
1
2
3
4
5
6
7
8
fn f() {}

fn main() {
    let x: u8 = unsafe {
        *std::mem::transmute::<fn(), *const u8>(f) //~ ERROR: contains a function
    };
    panic!("this should never print: {}", x);
}