Skip to content

False positive with type_repetition_in_bounds and generics #4323

Closed
@taiki-e

Description

@taiki-e

type_repetition_in_bounds seems missed generics in types.

#![allow(dead_code)]
#![warn(clippy::type_repetition_in_bounds)]

pub struct Foo<A>(A);

pub struct Bar<A, B> {
    a: Foo<A>,
    b: Foo<B>,
}

impl<A, B> Unpin for Bar<A, B>
where
    Foo<A>: Unpin,
    Foo<B>: Unpin, //~ WARN this type has already been used as a bound predicate
{
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thinggood first issueThese issues are a good way to get started with Clippy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions