-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add clippy::self_only_used_in_recursion
lint
#14787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add clippy::self_only_used_in_recursion
lint
#14787
Conversation
r? clippy |
a59c129
to
cc321f8
Compare
cc321f8
to
de3eac5
Compare
Since Samuel has already given a basic review, r? @samueltardieu |
de3eac5
to
e240635
Compare
There was a problem hiding this 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.
e240635
to
cb2e6f5
Compare
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. |
@pommicket What about:
|
and use it instead of clippy::only_used_in_recursion when the parameter in question is self.
cb2e6f5
to
63a5508
Compare
Sorry, fixed now. (I also switched the order for |
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. |
No, that's fine. Just making sure it wasn't a mistake. |
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 isself
; add pedanticself_only_used_in_recursion
lint.