Add `clippy::self_only_used_in_recursion` lint
and use it instead of clippy::only_used_in_recursion when the parameter in question is self.
Fixes rust-lang/rust-clippy#10370
changelog: [only_used_in_recursion]: Don't lint if parameter is self; add pedantic self_only_used_in_recursion lint.
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
r? clippy
Since Samuel has already given a basic review, r? @samueltardieu
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:
Also, could you move the Example section of the documentation before the Known problems one?
Sorry, fixed now. (I also switched the order for only_used_in_recursion to match.)
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?
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.