WIP: Add missing trait implementation lints#3752
WIP: Add missing trait implementation lints#3752Susurrus wants to merge 2 commits intorust-lang:masterfrom
Conversation
|
Also it looks like there is no code for checking if it's even possible to implement the traits so this might have a lot of false positives. |
Where do I have them set as part of the
This came up during the discussion in my Rust PR. I believe the lint for |
| $trait_check:ident) => ( | ||
| declare_clippy_lint! { | ||
| pub $lint_constant, | ||
| correctness, |
There was a problem hiding this comment.
This is where you give a lint its category
You don't want |
|
Ping from triage @Susurrus. Since rust-lang/rust#58070 is |
Posting this now so I can ensure I'm on the right track here.
This adds lints for if types are missing implementations of:
CloneCopyDebugDefaultDisplayEqHashOrdPartialEqPartialOrdContext here is in implementing RFC2235 we cannot auto-derive all traits. However, we still want the traits to be manually implemented. So we'd like lints to check on them.
I started this work in rust-lang/rust#58070, but it was suggested that these lints shouldn't be in the compiler and instead in Clippy. It was suggested that the existing lints for
CopyandDebugbe deprecated as part of this as well.Additionally these lints are part of #1798.
To fully implement all lints here, rust-lang/rust#58070 will need to be merged (which is still a work in progress) in order to get
Default,Display, andHashadded as lang_items so they can be easily checked on types.