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

#[deny(irrefutable_let_patterns)]
fn irrefutable_let_guard() {
    match Some(()) {
        Some(x) if let () = x => {}
        //~^ ERROR irrefutable `if let` guard
        _ => {}
    }
}

#[deny(unreachable_patterns)]
fn unreachable_pattern() {
    match Some(()) {
        x if let None | None = x => {}
        //~^ ERROR unreachable pattern
        _ => {}
    }
}

fn main() {}