diff options
Diffstat (limited to 'tests/ui/parser/recover-enum2.rs')
-rw-r--r-- | tests/ui/parser/recover-enum2.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/ui/parser/recover-enum2.rs b/tests/ui/parser/recover-enum2.rs new file mode 100644 index 000000000..0c9420889 --- /dev/null +++ b/tests/ui/parser/recover-enum2.rs @@ -0,0 +1,28 @@ +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 `{` + } + } +} |