about summary refs log tree commit diff
path: root/src/tools/miri/tests/fail/validity/match_binder_checks_validity1.rs
blob: 6c1df45ac0ecae17afc04e4651bdb895c51de21d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
fn main() {
    #[derive(Copy, Clone)]
    enum Void {}
    union Uninit<T: Copy> {
        value: T,
        uninit: (),
    }
    unsafe {
        let x: Uninit<Void> = Uninit { uninit: () };
        match x.value {
            #[allow(unreachable_patterns)]
            _x => println!("hi from the void!"), //~ERROR: invalid value
        }
    }
}