diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-11-28 12:06:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-28 12:06:07 +0100 |
| commit | 22c5bb0bdc6ab4729d829f7f9832c454267c1781 (patch) | |
| tree | 720312a4a0254619ba1eb7b8c462675524bec8e3 /compiler/rustc_parse/src/parser | |
| parent | 7201f70c3749c1cfabfa1280d3ce877e1dc7b0ee (diff) | |
| parent | c3c68c5cb1a6a00ed90f2443d3a387dbe437d6b0 (diff) | |
| download | rust-22c5bb0bdc6ab4729d829f7f9832c454267c1781.tar.gz rust-22c5bb0bdc6ab4729d829f7f9832c454267c1781.zip | |
Rollup merge of #133560 - clubby789:mut-mut-space, r=jieyouxu
Trim extra space in 'repeated `mut`' diagnostic Trim an extra space when removing repeated `mut`. Also an extra test for even more repeated `mut`s
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/pat.rs | 4 |
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 |
