aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src/grammar/items/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/libsyntax2/src/grammar/items/mod.rs')
-rw-r--r--crates/libsyntax2/src/grammar/items/mod.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/libsyntax2/src/grammar/items/mod.rs b/crates/libsyntax2/src/grammar/items/mod.rs
index 32d0778c4..a285892df 100644
--- a/crates/libsyntax2/src/grammar/items/mod.rs
+++ b/crates/libsyntax2/src/grammar/items/mod.rs
@@ -43,7 +43,12 @@ pub(super) fn item_or_macro(p: &mut Parser, stop_on_r_curly: bool, flavor: ItemF
43 m.abandon(p); 43 m.abandon(p);
44 if p.at(L_CURLY) { 44 if p.at(L_CURLY) {
45 error_block(p, "expected an item"); 45 error_block(p, "expected an item");
46 } else if !p.at(EOF) && !(stop_on_r_curly && p.at(R_CURLY)) { 46 } else if p.at(R_CURLY) && !stop_on_r_curly {
47 let e = p.start();
48 p.error("unmatched `}`");
49 p.bump();
50 e.complete(p, ERROR);
51 } else if !p.at(EOF) && !p.at(R_CURLY) {
47 p.err_and_bump("expected an item"); 52 p.err_and_bump("expected an item");
48 } else { 53 } else {
49 p.error("expected an item"); 54 p.error("expected an item");