Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add attribute on impl and associated lint for "no default methods" #14220

Closed
pnkfelix opened this issue May 15, 2014 · 3 comments
Closed

add attribute on impl and associated lint for "no default methods" #14220

pnkfelix opened this issue May 15, 2014 · 3 comments
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut.

Comments

@pnkfelix
Copy link
Member

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 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.

@seanmonstar
Copy link
Contributor

would this lint be included in rustc?

@steveklabnik steveklabnik added the A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. label Jan 23, 2015
@steveklabnik
Copy link
Member

Triage: no change that I'm aware of.

@steveklabnik
Copy link
Member

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!

lnicola pushed a commit to lnicola/rust that referenced this issue Mar 13, 2023
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants