wrong_self_convention triggers in trait method implementations #7123
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
Lint name: wrong_self_convention
I tried this code:
I expected to see this happen: nothing is linted
Instead, this happened: the from_char implementation for char and from_bool implementation for bool were linted because Clippy thinks the
value: Self
parameter is aself
parameter andfrom_*
methods shouldn't take self parameters.However,
FromMeta
is a trait and will be implemented by lots of different types. On some types, the trait names may seem slightly awkward, but I think there is not much the programmer can realistically do about that. I think it would be beneficial if this lint weren't triggered in trait implementations.Context: the
FromMeta
trait is similar in spirit to serde's Deserialize. It comes from the darling crate, a proc-macro attribute parser. Links for the offending trait implementations: bool and char.Meta
cargo clippy -V
: clippy 0.1.53 (b849326 2021-04-21)rustc -Vv
:The text was updated successfully, but these errors were encountered: