summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfcs/rfc-2294-if-let-guard/exhaustive.rs
blob: b4eb541398cfa3a6bb6922e0e2df413956450d80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#![feature(if_let_guard)]
#![allow(irrefutable_let_patterns)]

fn match_option(x: Option<u32>) {
    match x {
        //~^ ERROR non-exhaustive patterns: `None` not covered
        Some(_) => {}
        None if let y = x => {}
    }
}

fn main() {
    let x = ();
    match x {
        //~^ ERROR non-exhaustive patterns: `()` not covered
        y if let z = y => {}
    }
}