You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But in some bodies of code, the client would prefer to actually handle each case themselves (e.g. if they want to add debug log instrumentation to each call).
Right now if Sally implements TraitFoo which lives in a different crate for StructBar, and then tomorrow someone else adds a new method with a default implementation to TraitFoo to the next version of that crate, Sally will get no warning that maybe she might want to add another method implementation to StructBar.
I think niko proposed to me when we discussed this (in the context of the Visitor in PR #14145) that we add a way for the client to ask for their impl to be linted, checking that every method the trait is overridden locally.
The text was updated successfully, but these errors were encountered:
Since new lints have a big impact on users of rustc, the policy is that they should go through the RFC process like other user-facing changes. As such, I'm going to give this one a close, but if anyone comes across this ticket and wants this lint, consider adding it to clippy and/or writing up an RFC. Thanks!
…e, r=lnicola
minor: Don't use unstable `pointer` link
Our CI is failing because rustdoc is complaining we're using [unstable](rust-lang#80896) `pointer` link.
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
Feb 20, 2025
Default methods in traits are great.
But in some bodies of code, the client would prefer to actually handle each case themselves (e.g. if they want to add debug log instrumentation to each call).
Right now if Sally implements
TraitFoo
which lives in a different crate forStructBar
, and then tomorrow someone else adds a new method with a default implementation toTraitFoo
to the next version of that crate, Sally will get no warning that maybe she might want to add another method implementation toStructBar
.I think niko proposed to me when we discussed this (in the context of the Visitor in PR #14145) that we add a way for the client to ask for their impl to be linted, checking that every method the trait is overridden locally.
The text was updated successfully, but these errors were encountered: