min_ident_chars
triggers on implementation block for foreign traits
#13396
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
Summary
I have
renamed_function_params
lint enabled for foreign traits implementations, which means that a sampleimpl
block forDisplay
trait looks something like this:Enabling
min_ident_chars
on this code correctly flagsf
argument forfmt
method.I can disable this on the
impl
block, but I'm implementing this multiple times across the crate. Adding to each implementation can become needless noise. However, I still want to flag any instances of single-character arguments on my traits.Using the configuration
allowed-idents-below-min-chars
also doesn't make sense as I'd still want to flagf
as an argument name on my traits.I believe this lint should not be triggering on function arguments on impl blocks as their implementation details are provided by the crate owners.
In case this is not in the scope of this lint, may I propose a configuration option to disable triggering this lint on
impl
blocksmin-ident-chars-ignore-impl
Lint Name
min_ident_chars
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
The lint should not trigger
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: