about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorTyrone Wu <wudevelops@gmail.com>2024-11-15 02:27:51 +0000
committerTyrone Wu <wudevelops@gmail.com>2024-11-15 17:43:29 +0000
commitdd557c988f63ae000d56ced1ce52c86c507a47e3 (patch)
treef1695a9aadb37b462b0443d1c6e4fefdeb17abee /compiler/rustc_parse/src/parser
parentc82e0dff84f922274c3060f09b5ae78d5dbf5c49 (diff)
downloadrust-dd557c988f63ae000d56ced1ce52c86c507a47e3.tar.gz
rust-dd557c988f63ae000d56ced1ce52c86c507a47e3.zip
Trim whitespace in RemoveLet primary span
Separate `RemoveLet` span into primary span for `let` and removal
suggestion span for `let `, so that primary span does not include
whitespace.

Fixes: #133031

Signed-off-by: Tyrone Wu <wudevelops@gmail.com>
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/pat.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/pat.rs b/compiler/rustc_parse/src/parser/pat.rs
index 3546e5b0f04..c4326427f67 100644
--- a/compiler/rustc_parse/src/parser/pat.rs
+++ b/compiler/rustc_parse/src/parser/pat.rs
@@ -685,7 +685,7 @@ impl<'a> Parser<'a> {
             self.bump();
             // Trim extra space after the `let`
             let span = lo.with_hi(self.token.span.lo());
-            self.dcx().emit_err(RemoveLet { span });
+            self.dcx().emit_err(RemoveLet { span: lo, suggestion: span });
             lo = self.token.span;
         }