Skip to content

Improve span for unused_mut lint - #165282

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
lsunsi:issue165269
Nov 2, 2026
Merged

rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
lsunsi:issue165269

Conversation

@lsunsi

@lsunsi lsunsi commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Closes #165269

I basically used trim to avoid the overlap of spans mentioned on the issue. I kept the whitespace in the "mut" span since the fix removes the whole span and not removing the whitespace would mean for uglier code after fix.

If this is really important, I could add an extra span to the diagnostic struct, but I'll wait on feedback.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 1, 2026
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Nov 1, 2026
@rustbot

rustbot commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

r? @TaKO8Ki

rustbot has assigned @TaKO8Ki.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 77 candidates
  • Random selection from 22 candidates

@chenyukang

Copy link
Copy Markdown
Member

@bors r+ rollup

@rust-bors

rust-bors Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 576e161 has been approved by chenyukang

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 2, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Nov 2, 2026
Improve span for unused_mut lint

Closes rust-lang#165269

I basically used trim to avoid the overlap of spans mentioned on the issue. I kept the whitespace in the "mut" span since the fix removes the whole span and not removing the whitespace would mean for uglier code after fix.

If this is really important, I could add an extra span to the diagnostic struct, but I'll wait on feedback.
rust-bors Bot pushed a commit that referenced this pull request Nov 2, 2026
Rollup of 9 pull requests

Successful merges:

 - #162018 (Recover inner attributes in algebraic data types)
 - #162819 (Make the suggestion message of `unused_must_use` scarier.)
 - #163053 (Use verbose suggestion for type literal with wrong syntax)
 - #163245 (Fix multiple pattern comma suggestions in diagnostics)
 - #163369 (Don't lint unused_qualifications when the unqualified path is ambiguous)
 - #165282 (Improve span for unused_mut lint)
 - #165285 (Forward `AbiAlign` `Debug` impl to `Align`)
 - #165294 (unstable.rs: add missing `]` in description of `cfg_ub_checks`)
 - #165310 (Clarify AGENTS.md around pushing to a fork)
@rust-bors
rust-bors Bot merged commit 55330de into rust-lang:main Nov 2, 2026
14 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Nov 2, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 2, 2026
Rollup merge of #165282 - lsunsi:issue165269, r=chenyukang

Improve span for unused_mut lint

Closes #165269

I basically used trim to avoid the overlap of spans mentioned on the issue. I kept the whitespace in the "mut" span since the fix removes the whole span and not removing the whitespace would mean for uglier code after fix.

If this is really important, I could add an extra span to the diagnostic struct, but I'll wait on feedback.
@lsunsi
lsunsi deleted the issue165269 branch November 2, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Imprecise, overlapping spans in unused_mut

4 participants