summaryrefslogtreecommitdiffstats
path: root/tests/ui/parser/recover-from-bad-variant.rs
blob: e8887147cbc863a9debfa7ac8b91547874034b16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
enum Enum {
    Foo { a: usize, b: usize },
    Bar(usize, usize),
}

fn main() {
    let x = Enum::Foo(a: 3, b: 4);
    //~^ ERROR invalid `struct` delimiters or `fn` call arguments
    match x {
        Enum::Foo(a, b) => {}
        //~^ ERROR expected tuple struct or tuple variant, found struct variant `Enum::Foo`
        Enum::Bar { a, b } => {}
        //~^ ERROR tuple variant `Enum::Bar` written as struct variant
    }
}