Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak errors coming from for-loop, ? and .await desugaring #90939

Merged
merged 16 commits into from
Dec 15, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove unnecessary argument
  • Loading branch information
estebank committed Dec 13, 2021
commit 4f2b1c06506cc1277edf4fa46ed84f4e9e9dc671
4 changes: 2 additions & 2 deletions compiler/rustc_parse/src/parser/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ impl<'a> Parser<'a> {
/// Assuming we have just parsed `.`, continue parsing into an expression.
fn parse_dot_suffix(&mut self, self_arg: P<Expr>, lo: Span) -> PResult<'a, P<Expr>> {
if self.token.uninterpolated_span().rust_2018() && self.eat_keyword(kw::Await) {
return Ok(self.mk_await_expr(self_arg, lo));
return Ok(self.mk_await_expr(self_arg));
}

let fn_span_lo = self.token.span;
Expand Down Expand Up @@ -2838,7 +2838,7 @@ impl<'a> Parser<'a> {
ExprKind::Call(f, args)
}

fn mk_await_expr(&mut self, self_arg: P<Expr>, _lo: Span) -> P<Expr> {
fn mk_await_expr(&mut self, self_arg: P<Expr>) -> P<Expr> {
let span = self.prev_token.span;
let await_expr = self.mk_expr(span, ExprKind::Await(self_arg), AttrVec::new());
self.recover_from_await_method_call();
Expand Down