Skip to content

Structs with bounds on generics trigger lints #126

@Rosdf

Description

@Rosdf
trait MyTrait {}

#[derive_where(Debug; T: Debug)]
struct MyStruct<T: MyTrait> {
    t: T,
}

this code causes lint trigger

warning: type `T` has already been used as a bound predicate
   |
79 |     #[derive_where(Debug; T: Debug)]
   |                           ^^^^^^^^
   |
   = help: consider combining the bounds: `T: MyTrait + Debug`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions