Skip to content

Conversation

pommicket
Copy link
Contributor

@pommicket pommicket commented May 12, 2025

and use it instead of clippy::only_used_in_recursion when the parameter in question is self.

Fixes #10370

changelog: [only_used_in_recursion]: Don't lint if parameter is self; add pedantic self_only_used_in_recursion lint.

@rustbot
Copy link
Collaborator

rustbot commented May 12, 2025

r? @dswij

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

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label May 12, 2025
@dswij
Copy link
Member

dswij commented Jun 5, 2025

r? clippy

@rustbot rustbot assigned llogiq and unassigned dswij Jun 5, 2025
@pommicket pommicket force-pushed the self_only_used_in_recursion branch 2 times, most recently from a59c129 to cc321f8 Compare June 6, 2025 14:30
@pommicket pommicket requested a review from samueltardieu June 14, 2025 21:41
@pommicket pommicket force-pushed the self_only_used_in_recursion branch from cc321f8 to de3eac5 Compare July 4, 2025 15:16
@llogiq
Copy link
Contributor

llogiq commented Jul 6, 2025

Since Samuel has already given a basic review, r? @samueltardieu

@rustbot rustbot assigned samueltardieu and unassigned llogiq Jul 6, 2025
@samueltardieu samueltardieu added the A-lint Area: New lints label Jul 11, 2025
@pommicket pommicket force-pushed the self_only_used_in_recursion branch from de3eac5 to e240635 Compare August 11, 2025 22:15
Copy link
Member

@samueltardieu samueltardieu left a comment

Choose a reason for hiding this comment

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

This looks good to me. Could you apply the suggested refactoring, renumber the Clippy version? Also, could you move the Example section of the documentation before the Known problems one?

I've opened a FCP thread on Zulip to get other team members opinion about this lint.

View changes since this review

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Sep 18, 2025
@pommicket pommicket force-pushed the self_only_used_in_recursion branch from e240635 to cb2e6f5 Compare September 18, 2025 14:33
@rustbot
Copy link
Collaborator

rustbot commented Sep 18, 2025

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.

@samueltardieu
Copy link
Member

@pommicket What about:

Also, could you move the Example section of the documentation before the Known problems one?

and use it instead of clippy::only_used_in_recursion
when the parameter in question is self.
@pommicket pommicket force-pushed the self_only_used_in_recursion branch from cb2e6f5 to 63a5508 Compare September 18, 2025 17:48
@pommicket
Copy link
Contributor Author

Sorry, fixed now. (I also switched the order for only_used_in_recursion to match.)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties and removed S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels Sep 18, 2025
@pommicket
Copy link
Contributor Author

Actually it looks like most lints currently have Known Problems before Examples. Is there a reason for putting it in the opposite order for this lint?

@samueltardieu
Copy link
Member

Actually it looks like most lints currently have Known Problems before Examples. Is there a reason for putting it in the opposite order for this lint?

The "known problems" is particularly long on this one, but I don't care that much if you prefer to keep it that way.

@pommicket
Copy link
Contributor Author

No, that's fine. Just making sure it wasn't a mistake.

@samueltardieu samueltardieu added the S-final-comment-period Status: final comment period it will be merged unless new objections are raised (~1 week) label Sep 18, 2025
@samueltardieu samueltardieu added this pull request to the merge queue Sep 19, 2025
Merged via the queue into rust-lang:master with commit 8ea47a6 Sep 19, 2025
11 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-lint Area: New lints S-final-comment-period Status: final comment period it will be merged unless new objections are raised (~1 week)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

clippy::only_used_in_recursion considers self, but unused_variables does not

5 participants