rust-clippy icon indicating copy to clipboard operation
rust-clippy copied to clipboard

Add `clippy::self_only_used_in_recursion` lint

Open pommicket opened this issue 11 months ago • 2 comments

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.

pommicket avatar May 12 '25 14:05 pommicket

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 avatar May 12 '25 14:05 rustbot

r? clippy

dswij avatar Jun 05 '25 15:06 dswij

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

llogiq avatar Jul 06 '25 15:07 llogiq

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.

rustbot avatar Sep 18 '25 14:09 rustbot

@pommicket What about:

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

samueltardieu avatar Sep 18 '25 17:09 samueltardieu

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

pommicket avatar Sep 18 '25 17:09 pommicket

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?

pommicket avatar Sep 18 '25 18:09 pommicket

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.

samueltardieu avatar Sep 18 '25 18:09 samueltardieu

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

pommicket avatar Sep 18 '25 19:09 pommicket