Skip to content

Add new lint fn_arg_mut_rebindings#16492

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

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

Conversation

@faeroon

@faeroon faeroon commented Feb 1, 2026

Copy link
Copy Markdown

View all comments

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

rustbot commented Feb 1, 2026

Copy link
Copy Markdown
Collaborator

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

github-actions Bot commented Feb 1, 2026

Copy link
Copy Markdown

Lintcheck changes for 3162ebe

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

This comment has been minimized.

@rustbot

This comment has been minimized.

@faeroon

faeroon commented May 31, 2026

Copy link
Copy Markdown
Author

r? clippy

@rustbot rustbot assigned ada4a and unassigned llogiq May 31, 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

rustbot commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

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

4 participants