aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src/grammar/expressions/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/libsyntax2/src/grammar/expressions/mod.rs')
-rw-r--r--crates/libsyntax2/src/grammar/expressions/mod.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/libsyntax2/src/grammar/expressions/mod.rs b/crates/libsyntax2/src/grammar/expressions/mod.rs
index bd6c84886..922d9f871 100644
--- a/crates/libsyntax2/src/grammar/expressions/mod.rs
+++ b/crates/libsyntax2/src/grammar/expressions/mod.rs
@@ -26,7 +26,10 @@ fn expr_no_struct(p: &mut Parser) {
26// fn c() { 1; 2; } 26// fn c() { 1; 2; }
27// fn d() { 1; 2 } 27// fn d() { 1; 2 }
28pub(crate) fn block(p: &mut Parser) { 28pub(crate) fn block(p: &mut Parser) {
29 assert!(p.at(L_CURLY)); 29 if !p.at(L_CURLY) {
30 p.error("expected a block");
31 return;
32 }
30 let m = p.start(); 33 let m = p.start();
31 p.bump(); 34 p.bump();
32 while !p.at(EOF) && !p.at(R_CURLY) { 35 while !p.at(EOF) && !p.at(R_CURLY) {