Closed mladedav closed 2 weeks ago
Good news, we have a lint for this: https://rust-lang.github.io/rust-clippy/master/index.html#/missing_trait_methods
Thanks and sorry for the noise. I did try to find it (unimplemented, trait and keywords like that) but didn't find it.
What it does
Forces useers to implement all methods in a trait, including all methods with default implementations.
This would be allow-by-default restriction lint. This makes sense to turn on only in specific scenarios.
Advantage
Drawbacks
Example
Now if the
Record
trait is extended with a new method with default implementation such asrecord_str(str: &str)
the default implementation would be bad for implementations leveraging theHasRecord
type. As I user, I'd like a way to tell clippy that I want to be notified, if any method is not explicitly defined in a givenimpl
block.