Open CobaltCause opened 6 months ago
looks like it was intended by design, but the doc didn't specify that: https://github.com/rust-lang/rust-clippy/blob/a4a1a7365d60280b83d83374fda97742fb959239/clippy_lints/src/functions/impl_trait_in_params.rs#L61
Hmm, I just read through the PR in which the lint was added (https://github.com/rust-lang/rust-clippy/pull/10197) and there wasn't any discussion about whether this was desirable or intentional. Maybe it being written this way was accidental. Either way, I personally think this lint should apply to all instances, not just public ones.
This was as per the original request: https://github.com/rust-lang/rust-clippy/issues/10030. The rational is that in internal items it's easy to just write impl Foo
and because the function is internal you can change it at any time if you realize you need a turbofish.
Summary
The lint only appears for public functions (i.e. public API surface of a library).
Lint Name
impl_trait_in_params
Reproducer
I tried this code:
I expected to see this happen:
2 instances of
impl_trait_in_params
should appear, one for each function.Instead, this happened:
Only 1 instance appeared for the
pub
function:Version