about summary refs log tree commit diff
path: root/src/tools/miri/tests/fail/validity/ref_to_uninhabited2.rs
blob: 8934a06b5d73a7b0519b584964bb7fa995f59be9 (plain)
1
2
3
4
5
6
7
8
9
use std::mem::transmute;

enum Void {}

fn main() {
    unsafe {
        let _x: &(i32, Void) = transmute(&42); //~ERROR: encountered a reference pointing to uninhabited type (i32, Void)
    }
}