Skip to content

Add new lint fn_arg_mut_rebindings#16492

Open
faeroon wants to merge 1 commit intorust-lang:masterfrom
faeroon:issues/1657
Open

Add new lint fn_arg_mut_rebindings#16492
faeroon wants to merge 1 commit intorust-lang:masterfrom
faeroon:issues/1657

Conversation

@faeroon
Copy link
Copy Markdown

@faeroon faeroon commented Feb 1, 2026

implements lint for checking argument rebindings as mut variable

changelog: [fn_arg_mut_rebindings]

  • Followed lint naming conventions
  • Added passing UI tests (including committed .stderr file)
  • cargo test passes locally
  • Executed cargo dev update_lints
  • Added lint documentation
  • Run cargo dev fmt

Fixes #1657. Based on comments for previous PR #6245. Changes comparing to previous:

  1. renames lint to satisfy naming convention
  2. applies lint only to let mut x = x; statements with scope of function body
  3. skips lint for trait implementation functions

@rustbot rustbot added needs-fcp PRs that add, remove, or rename lints and need an FCP S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Feb 1, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Feb 1, 2026

r? @llogiq

rustbot has assigned @llogiq.
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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 1, 2026

Lintcheck changes for ca552cf

Lint Added Removed Changed
clippy::fn_arg_mut_rebindings 5 0 0

This comment will be updated if you push new changes

@faeroon faeroon changed the title add new lint 'fn_arg_mut_rebindings' Add new lint fn_arg_mut_rebindings Feb 1, 2026
@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 25, 2026

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-fcp PRs that add, remove, or rename lints and need an FCP S-waiting-on-review Status: Awaiting review from the assignee but also interested parties

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lint let mut x = x; where x is a function argument

3 participants