From 15f15d92eb4d6ab791047eefbd6dd9b2baba1140 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 28 Aug 2018 23:59:57 +0300 Subject: add impl works with lifetimes --- crates/libsyntax2/src/grammar/expressions/atom.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'crates/libsyntax2/src/grammar/expressions/atom.rs') 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 { p.eat(MOVE_KW); params::param_list_opt_types(p); if opt_fn_ret_type(p) { - block(p); - } else { - expr(p); + if !p.at(L_CURLY) { + p.error("expected `{`"); + } } + expr(p); m.complete(p, LAMBDA_EXPR) } -- cgit v1.2.3