mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Improve recovery for incomplete lambdas
This commit is contained in:
parent
cb79e30d53
commit
3e2f4e4293
3 changed files with 94 additions and 1 deletions
|
@ -248,7 +248,12 @@ fn lambda_expr(p: &mut Parser) -> CompletedMarker {
|
|||
p.error("expected `{`");
|
||||
}
|
||||
}
|
||||
expr(p);
|
||||
|
||||
if p.at_ts(EXPR_FIRST) {
|
||||
expr(p);
|
||||
} else {
|
||||
p.error("expected expression");
|
||||
}
|
||||
m.complete(p, LAMBDA_EXPR)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue