diff options
Diffstat (limited to 'crates/libsyntax2/src/grammar')
-rw-r--r-- | crates/libsyntax2/src/grammar/expressions/atom.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/libsyntax2/src/grammar/expressions/atom.rs b/crates/libsyntax2/src/grammar/expressions/atom.rs index 0769bb5a8..a17c27b31 100644 --- a/crates/libsyntax2/src/grammar/expressions/atom.rs +++ b/crates/libsyntax2/src/grammar/expressions/atom.rs | |||
@@ -151,10 +151,11 @@ fn lambda_expr(p: &mut Parser) -> CompletedMarker { | |||
151 | p.eat(MOVE_KW); | 151 | p.eat(MOVE_KW); |
152 | params::param_list_opt_types(p); | 152 | params::param_list_opt_types(p); |
153 | if opt_fn_ret_type(p) { | 153 | if opt_fn_ret_type(p) { |
154 | block(p); | 154 | if !p.at(L_CURLY) { |
155 | } else { | 155 | p.error("expected `{`"); |
156 | expr(p); | 156 | } |
157 | } | 157 | } |
158 | expr(p); | ||
158 | m.complete(p, LAMBDA_EXPR) | 159 | m.complete(p, LAMBDA_EXPR) |
159 | } | 160 | } |
160 | 161 | ||