summaryrefslogtreecommitdiffstats
path: root/tests/ui/pattern/usefulness/match-privately-empty.rs
blob: 315eb03d165642a9300580b3ab78761b551414af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#![feature(never_type)]
#![feature(exhaustive_patterns)]

mod private {
    pub struct Private {
        _bot: !,
        pub misc: bool,
    }
    pub const DATA: Option<Private> = None;
}

fn main() {
    match private::DATA {
    //~^ ERROR non-exhaustive patterns: `Some(Private { misc: true, .. })` not covered
        None => {}
        Some(private::Private {
            misc: false,
            ..
        }) => {}
    }
}