ITADN

Structs with bounds on generics trigger lints

#126OpenRosdf 创建于 2025-08-02
R
Rosdfcommented
```rust 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 ```
1 条评论