summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfcs/rfc-2294-if-let-guard/macro-expanded.rs
blob: 423a2cd53fc5c71fafffcbcfa68f36ce256862ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Expression macros can't expand to a let match guard.

#![feature(if_let_guard)]
#![feature(let_chains)]

macro_rules! m {
    ($e:expr) => { let Some(x) = $e }
    //~^ ERROR expected expression, found `let` statement
}

fn main() {
    match () {
        () if m!(Some(5)) => {}
        _ => {}
    }
}