diff options
author | Aleksey Kladov <[email protected]> | 2018-08-27 19:10:02 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-27 19:10:02 +0100 |
commit | b79c8b6d8a3b38c94de992a54ffb9055c1ad6f31 (patch) | |
tree | 4979b92b8f4e41bf55e4e1404a8cb183c034d6d7 /crates/libsyntax2/src/grammar/items/traits.rs | |
parent | 7f4b07a9076a38b2bd0fa0518ba090311dcaf880 (diff) |
Fix error blocks
Diffstat (limited to 'crates/libsyntax2/src/grammar/items/traits.rs')
-rw-r--r-- | crates/libsyntax2/src/grammar/items/traits.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/libsyntax2/src/grammar/items/traits.rs b/crates/libsyntax2/src/grammar/items/traits.rs index 3853ccaab..01b79e3c9 100644 --- a/crates/libsyntax2/src/grammar/items/traits.rs +++ b/crates/libsyntax2/src/grammar/items/traits.rs | |||
@@ -30,6 +30,10 @@ fn trait_item_list(p: &mut Parser) { | |||
30 | let m = p.start(); | 30 | let m = p.start(); |
31 | p.bump(); | 31 | p.bump(); |
32 | while !p.at(EOF) && !p.at(R_CURLY) { | 32 | while !p.at(EOF) && !p.at(R_CURLY) { |
33 | if p.at(L_CURLY) { | ||
34 | error_block(p, "expected an item"); | ||
35 | continue; | ||
36 | } | ||
33 | item_or_macro(p, true, ItemFlavor::Trait); | 37 | item_or_macro(p, true, ItemFlavor::Trait); |
34 | } | 38 | } |
35 | p.expect(R_CURLY); | 39 | p.expect(R_CURLY); |
@@ -76,6 +80,10 @@ fn impl_item_list(p: &mut Parser) { | |||
76 | p.bump(); | 80 | p.bump(); |
77 | 81 | ||
78 | while !p.at(EOF) && !p.at(R_CURLY) { | 82 | while !p.at(EOF) && !p.at(R_CURLY) { |
83 | if p.at(L_CURLY) { | ||
84 | error_block(p, "expected an item"); | ||
85 | continue; | ||
86 | } | ||
79 | item_or_macro(p, true, ItemFlavor::Mod); | 87 | item_or_macro(p, true, ItemFlavor::Mod); |
80 | } | 88 | } |
81 | p.expect(R_CURLY); | 89 | p.expect(R_CURLY); |