diff options
| author | bors <bors@rust-lang.org> | 2023-05-01 03:47:09 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-05-01 03:47:09 +0000 |
| commit | 2034b6d23ca18311a23273f2f08c381a04fa05d9 (patch) | |
| tree | 0a3a4181685b77abfe80c67c7afa3c759ed0adb9 /compiler/rustc_parse/src | |
| parent | 9ecda8de85ce893cc3fc748ab06be0b8250147a7 (diff) | |
| parent | 9de14d894b7483c521a7fdfa86301b760f36c3a7 (diff) | |
| download | rust-2034b6d23ca18311a23273f2f08c381a04fa05d9.tar.gz rust-2034b6d23ca18311a23273f2f08c381a04fa05d9.zip | |
Auto merge of #111040 - matthiaskrgr:rollup-g2sns0f, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #110823 (Tweak await span to not contain dot) - #111015 (Remove wrong assertion in match checking.) - #111023 (Test precise capture with a multi-variant enum and exhaustive patterns) - #111032 (Migrate `builtin_macros::asm` diagnostics to translatable diagnostics) - #111033 (Ping Nadrieril when changing exhaustiveness checking) - #111037 (Close parentheses for `offset_of` in AST pretty printing) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src')
| -rw-r--r-- | compiler/rustc_parse/src/parser/diagnostics.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index c14c7f2fa0d..0e041df898c 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -1646,7 +1646,7 @@ impl<'a> Parser<'a> { // Avoid knock-down errors as we don't know whether to interpret this as `foo().await?` // or `foo()?.await` (the very reason we went with postfix syntax 😅). ExprKind::Try(_) => ExprKind::Err, - _ => ExprKind::Await(expr), + _ => ExprKind::Await(expr, await_sp), }; let expr = self.mk_expr(lo.to(sp), kind); self.maybe_recover_from_bad_qpath(expr) diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 27de9bd7268..bff9de5c652 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -859,7 +859,7 @@ impl<'a> Parser<'a> { ExprKind::Field(_, _) => "a field access", ExprKind::MethodCall(_) => "a method call", ExprKind::Call(_, _) => "a function call", - ExprKind::Await(_) => "`.await`", + ExprKind::Await(_, _) => "`.await`", ExprKind::Err => return Ok(with_postfix), _ => unreachable!("parse_dot_or_call_expr_with_ shouldn't produce this"), } @@ -3252,7 +3252,7 @@ impl<'a> Parser<'a> { fn mk_await_expr(&mut self, self_arg: P<Expr>, lo: Span) -> P<Expr> { let span = lo.to(self.prev_token.span); - let await_expr = self.mk_expr(span, ExprKind::Await(self_arg)); + let await_expr = self.mk_expr(span, ExprKind::Await(self_arg, self.prev_token.span)); self.recover_from_await_method_call(); await_expr } |
