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-28 11:20:29 +0000
committerbors <bors@rust-lang.org>2024-11-28 11:20:29 +0000
commit9b4d7c6a40b328d212095c28670c629facf1557d (patch)
treef0f0884d025a32f341ca446becc17582e1a7c486 /compiler/rustc_parse/src/parser
parentc1cfab230ebb2e9cb9f4ea69773fef956c706a71 (diff)
parent22c5bb0bdc6ab4729d829f7f9832c454267c1781 (diff)
downloadrust-9b4d7c6a40b328d212095c28670c629facf1557d.tar.gz
rust-9b4d7c6a40b328d212095c28670c629facf1557d.zip
Auto merge of #133568 - GuillaumeGomez:rollup-js22ovb, r=GuillaumeGomez
Rollup of 7 pull requests

Successful merges:

 - #133358 (Don't type error if we fail to coerce `Pin<T>` because it doesnt contain a ref)
 - #133422 (Fix clobber_abi in RV32E and RV64E inline assembly)
 - #133452 (Support predicate registers (clobber-only) in Hexagon inline assembly)
 - #133463 (Fix handling of x18 in AArch64 inline assembly on ohos/trusty or with -Zfixed-x18)
 - #133487 (fix confusing diagnostic for reserved `##`)
 - #133557 (Small doc fixes in `rustc_codegen_ssa`)
 - #133560 (Trim extra space in 'repeated `mut`' diagnostic)

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 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