Skip to content

Unnecessary type repetition in trait bound #3764

Closed
@xd009642

Description

@xd009642

So I raised this on rust-lang/rust#58471 and it was suggested this is better as a clippy lint so pasting the issue text here for quick reference:

My where clauses in traits recently had some unnecessary noise that the compiler could warn against:

What I was doing:

impl<T> SomeTrait<T> where T: Clone, T: Debug

What I should have been doing:

impl<T> SomeTrait<T> where T: Clone + Debug

I'd be happy to implement this myself if there's a consensus on adding this as a warning, though I may > need some mentoring 👍

The offer to help with a PR myself still stands, I had a quick check of the lints and didn't spot it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lintsL-complexityLint: Belongs in the complexity lint group

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions