mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-22 03:44:24 +00:00
parse_bottom_expr: extract common 'return' out.
This commit is contained in:
parent
9b4a630baa
commit
b680b66ddd
@ -2643,13 +2643,12 @@ impl<'a> Parser<'a> {
|
||||
hi = path.span;
|
||||
return Ok(self.mk_expr(lo.to(hi), ExprKind::Path(Some(qself), path), attrs));
|
||||
}
|
||||
if self.span.rust_2018() && self.check_keyword(keywords::Async)
|
||||
{
|
||||
if self.is_async_block() { // check for `async {` and `async move {`
|
||||
return self.parse_async_block(attrs);
|
||||
if self.span.rust_2018() && self.check_keyword(keywords::Async) {
|
||||
return if self.is_async_block() { // check for `async {` and `async move {`
|
||||
self.parse_async_block(attrs)
|
||||
} else {
|
||||
return self.parse_lambda_expr(attrs);
|
||||
}
|
||||
self.parse_lambda_expr(attrs)
|
||||
};
|
||||
}
|
||||
if self.check_keyword(keywords::Move) || self.check_keyword(keywords::Static) {
|
||||
return self.parse_lambda_expr(attrs);
|
||||
|
Loading…
Reference in New Issue
Block a user