aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/tests/data/parser/err/0025_nope.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-09-08 08:55:09 +0100
committerAleksey Kladov <[email protected]>2018-09-08 08:55:09 +0100
commitf48b9d9be737339be988042ca88d31330738618c (patch)
tree5d509fa71a1bb5286faa8b3691d4d757e5b5c8c6 /crates/libsyntax2/tests/data/parser/err/0025_nope.rs
parent749907d330e5487eb7997479e2aba4ac2c2e3494 (diff)
Fix block structure in enums
Diffstat (limited to 'crates/libsyntax2/tests/data/parser/err/0025_nope.rs')
-rw-r--r--crates/libsyntax2/tests/data/parser/err/0025_nope.rs31
1 files changed, 31 insertions, 0 deletions
diff --git a/crates/libsyntax2/tests/data/parser/err/0025_nope.rs b/crates/libsyntax2/tests/data/parser/err/0025_nope.rs
new file mode 100644
index 000000000..28726ed51
--- /dev/null
+++ b/crates/libsyntax2/tests/data/parser/err/0025_nope.rs
@@ -0,0 +1,31 @@
1fn main() {
2 enum Test {
3 Var1,
4 Var2(String),
5 Var3 {
6 abc: {}, //~ ERROR: expected type, found `{`
7 },
8 }
9
10 // recover...
11 let a = 1;
12 enum Test2 {
13 Fine,
14 }
15
16 enum Test3 {
17 StillFine {
18 def: i32,
19 },
20 }
21
22 {
23 // fail again
24 enum Test4 {
25 Nope(i32 {}) //~ ERROR: found `{`
26 //~^ ERROR: found `{`
27 }
28 }
29 // still recover later
30 let bad_syntax = _; //~ ERROR: expected expression, found reserved identifier `_`
31}