Skip to content

Respect inline allows in needless_pass_by_value - #17665

Merged
Jarcho merged 1 commit into
rust-lang:masterfrom
KevinSailema:fix/needless-pass-by-value-inline-allow
Sep 1, 2026
Merged

Respect inline allows in needless_pass_by_value#17665
Jarcho merged 1 commit into
rust-lang:masterfrom
KevinSailema:fix/needless-pass-by-value-inline-allow

Conversation

@KevinSailema

@KevinSailema KevinSailema commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Fixes #17664

Make needless_pass_by_value emit diagnostics using the HirId of the function argument. This ensures inline #[allow(clippy::needless_pass_by_value)] attributes on arguments suppress the corresponding diagnostic.

Added a UI regression test for an allowed String argument.

changelog: [needless_pass_by_value]: Respect inline #[allow] attributes on function arguments.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rustbot rustbot added S-waiting-on-community-reviews Status: This is awaiting for positive reviews from the community before a maintainer is assigned. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Aug 31, 2026
@rustbot

rustbot commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome!

You should hear from one of our reviewers after this PR gets at least 2 reviews from the community.

Please see the contribution instructions for more information.

@CommanderStorm CommanderStorm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Community review: LGTM

View changes since this review

@rustbot rustbot removed the S-waiting-on-community-reviews Status: This is awaiting for positive reviews from the community before a maintainer is assigned. label Aug 31, 2026
@rustbot

rustbot commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

r? @llogiq

rustbot has assigned @llogiq for the project review.
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: 9 candidates
  • 9 candidates expanded to 9 candidates
  • Random selection from Jarcho, Manishearth, blyxyas, dswij, llogiq

@Jarcho
Jarcho added this pull request to the merge queue Sep 1, 2026
Merged via the queue into rust-lang:master with commit 5c00384 Sep 1, 2026
13 of 19 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clippy does not respect inline #[allow(…)] attribute

5 participants