summaryrefslogtreecommitdiffstats
path: root/src/test/ui/rfc-2294-if-let-guard/typeck.rs
blob: ad178dfa43947b1c4d682721b6c7dd24df94fa0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#![feature(if_let_guard)]

fn ok() -> Result<Option<bool>, ()> {
    Ok(Some(true))
}

fn main() {
    match ok() {
        Ok(x) if let Err(_) = x => {},
        //~^ ERROR mismatched types
        Ok(x) if let 0 = x => {},
        //~^ ERROR mismatched types
        _ => {}
    }
}