-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
lint for redundant trait bounds (due to trait inheritance) #9197
Comments
We don't currently warn for even more obvious redundant bounds as well: trait Foo {}
fn foo<T: Foo+Foo>() {} |
Visiting for triage. Still doesn't warn. |
Interested in trying, will find @thestinger on IRC. |
Actually...who's mentoring this? |
Triage: This errors now! Should be closed. |
@reem the trivial case errors, but the original case reported here still doesn't |
This should either be closed or the E-needstest label removed. Here's a case that demonstrates the problem: trait Foo {
fn noop(&self) {}
}
trait Bar: Foo {}
#[allow(dead_code)]
fn bar<T: Foo + Bar>() {}
fn main() {} |
It looks like there is no error nor warning for redundant traits |
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! |
* Allowing `unsafe_removed_from_name` on imports produces a false positive on `useless_attribute`. Fixes: rust-lang#9197 Signed-off-by: Andy-Python-Programmer <andypythonappdeveloper@gmail.com>
lint::unsafe_removed_from_name: fix false positive result when allowed changelog: [`unsafe_removed_from_name`] Fix allowing on imports produces a false positive on `useless_attribute`. Fixes: rust-lang#9197 Signed-off-by: Andy-Python-Programmer <andypythonappdeveloper@gmail.com>
We should give a warning that the
Foo
bound is redundant:The text was updated successfully, but these errors were encountered: