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

Style lint suggestion: deny duplicate methods of trait bounds #5777

Closed
rossmacarthur opened this issue Jul 8, 2020 · 0 comments
Closed

Style lint suggestion: deny duplicate methods of trait bounds #5777

rossmacarthur opened this issue Jul 8, 2020 · 0 comments
Labels
A-lint Area: New lints good-first-issue These issues are a good way to get started with Clippy

Comments

@rossmacarthur
Copy link

What it does

Checks for cases where generics are being used and multiple syntax specifications for trait bounds are used simultaneously.

Categories

  • Kind: clippy::style, clippy::pedantic

Drawbacks

Perhaps there are contexts where this communicates information clearer?

Example

fn func<T: Clone + Default>(arg: T)
where
    T: Clone + Default,
{
    todo!()
}

Could be written as:

fn func<T: Clone + Default>(arg: T) {
    todo!()
}

or

fn func<T>(arg: T)
where
    T: Clone + Default,
{
    todo!()
}

or

fn func(arg: impl Clone + Default) {
    todo!()
}
@rossmacarthur rossmacarthur added the A-lint Area: New lints label Jul 8, 2020
@flip1995 flip1995 added the good-first-issue These issues are a good way to get started with Clippy label Jul 13, 2020
wiomoc added a commit to wiomoc/rust-clippy that referenced this issue Jul 28, 2020
wiomoc added a commit to wiomoc/rust-clippy that referenced this issue Jul 28, 2020
bors added a commit that referenced this issue Aug 3, 2020
Add lint for duplicate methods of trait bounds

rel: #5777

changelog: Add [`trait_duplication_in_bounds`] lint
flip1995 added a commit to flip1995/rust-clippy that referenced this issue Aug 4, 2020
… r=Manishearth

Add lint for duplicate methods of trait bounds

rel: rust-lang#5777

changelog: Add [`trait_duplication_in_bounds`] lint
flip1995 added a commit to flip1995/rust-clippy that referenced this issue Aug 4, 2020
… r=Manishearth

Add lint for duplicate methods of trait bounds

rel: rust-lang#5777

changelog: Add [`trait_duplication_in_bounds`] lint
@bors bors closed this as completed in 94c50bc Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints good-first-issue These issues are a good way to get started with Clippy
Projects
None yet
Development

No branches or pull requests

2 participants