aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/test_data/parser/err/0025_nope.rs
blob: 28726ed5138dcfe4ca83831bc8c26fd998ba419b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
fn main() {
    enum Test {
        Var1,
        Var2(String),
        Var3 {
            abc: {}, //~ ERROR: expected type, found `{`
        },
    }

    // recover...
    let a = 1;
    enum Test2 {
        Fine,
    }

    enum Test3 {
        StillFine {
            def: i32,
        },
    }

    {
        // fail again
        enum Test4 {
            Nope(i32 {}) //~ ERROR: found `{`
                         //~^ ERROR: found `{`
        }
    }
    // still recover later
    let bad_syntax = _; //~ ERROR: expected expression, found reserved identifier `_`
}