aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src/grammar/items/traits.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/libsyntax2/src/grammar/items/traits.rs')
-rw-r--r--crates/libsyntax2/src/grammar/items/traits.rs8
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);