summaryrefslogtreecommitdiffstats
path: root/tests/ui/parser/macro/macro-expand-to-match-arm.rs
blob: 39d1d065ed986f0464232860f92793404beed103 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
macro_rules! arm {
    ($pattern:pat => $block:block) => {
        $pattern => $block
    };
}

fn main() {
    let x = Some(1);
    match x {
        Some(1) => {},
        arm!(None => {}),
        //~^ NOTE macros cannot expand to match arms
        //~| ERROR unexpected `,` in pattern
        // doesn't recover
        Some(2) => {},
        _ => {},
    };
}