summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfcs/rfc-2497-if-let-chains/ast-validate-guards.rs
blob: e6dee2a1d061313535965d66a68afae66300a2d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#![feature(let_chains)]

fn let_or_guard(x: Result<Option<i32>, ()>) {
    match x {
        Ok(opt) if let Some(4) = opt || false  => {}
        //~^ ERROR `let` expressions are not supported here
        _ => {}
    }
}

fn hiding_unsafe_mod(x: Result<Option<i32>, ()>) {
    match x {
        Ok(opt)
            if {
                unsafe mod a {};
                //~^ ERROR module cannot be declared unsafe
                false
            } => {}
        _ => {}
    }
}

fn main() {}