about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorclubby789 <jamie@hill-daniel.co.uk>2024-11-28 01:35:36 +0000
committerclubby789 <jamie@hill-daniel.co.uk>2024-11-28 01:37:01 +0000
commitc3c68c5cb1a6a00ed90f2443d3a387dbe437d6b0 (patch)
tree68a7b8c59a005dbd3f3edd512b526483db3d61f9 /compiler/rustc_parse/src/parser
parentc322cd5c5ac13b5ef16a487c889f8c148d8e3841 (diff)
downloadrust-c3c68c5cb1a6a00ed90f2443d3a387dbe437d6b0.tar.gz
rust-c3c68c5cb1a6a00ed90f2443d3a387dbe437d6b0.zip
Trim extra space in 'repeated `mut`' diagnostic
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 004b5b34813..bb976e092bf 100644
--- a/compiler/rustc_parse/src/parser/pat.rs
+++ b/compiler/rustc_parse/src/parser/pat.rs
@@ -1089,7 +1089,9 @@ impl<'a> Parser<'a> {
             return;
         }
 
-        self.dcx().emit_err(RepeatedMutInPattern { span: lo.to(self.prev_token.span) });
+        let span = lo.to(self.prev_token.span);
+        let suggestion = span.with_hi(self.token.span.lo());
+        self.dcx().emit_err(RepeatedMutInPattern { span, suggestion });
     }
 
     /// Parse macro invocation