about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-11-14 01:15:35 +0000
committerbors <bors@rust-lang.org>2024-11-14 01:15:35 +0000
commitbd0826a4521a845f36cce1b00e1dd2918ba09e90 (patch)
tree0f693c16f0146c0359874f3d1e9210ba82ed8db9 /compiler/rustc_parse/src/parser
parent8adb4b30f40e6fbd21dc1ba26c3301c7eeb6de3c (diff)
parent2e13bf6379c6a24c58e2b3737010254438274bbd (diff)
downloadrust-bd0826a4521a845f36cce1b00e1dd2918ba09e90.tar.gz
rust-bd0826a4521a845f36cce1b00e1dd2918ba09e90.zip
Auto merge of #133006 - matthiaskrgr:rollup-dz6oiq5, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #126046 (Implement `mixed_integer_ops_unsigned_sub`)
 - #132302 (rustdoc: Treat declarative macros more like other item kinds)
 - #132842 (ABI checks: add support for tier2 arches)
 - #132995 (compiletest: Add ``exact-llvm-major-version`` directive)
 - #132996 (Trim extra space when suggesting removing bad `let`)
 - #132998 (Unvacation myself)
 - #133000 ([rustdoc] Fix duplicated footnote IDs)
 - #133001 (actually test next solver)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/pat.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/pat.rs b/compiler/rustc_parse/src/parser/pat.rs
index 7f114013320..3546e5b0f04 100644
--- a/compiler/rustc_parse/src/parser/pat.rs
+++ b/compiler/rustc_parse/src/parser/pat.rs
@@ -683,7 +683,9 @@ impl<'a> Parser<'a> {
             })
         {
             self.bump();
-            self.dcx().emit_err(RemoveLet { span: lo });
+            // Trim extra space after the `let`
+            let span = lo.with_hi(self.token.span.lo());
+            self.dcx().emit_err(RemoveLet { span });
             lo = self.token.span;
         }