Closed
Description
Summary
@giraffate caught this issue in #8703 PR which is based on the TRAIT_DUPLICATION_IN_BOUNDS lint.
Lint Name
TRAIT_DUPLICATION_IN_BOUNDS
Reproducer
I tried this code:
trait BoundWithGeneric<T> {}
fn good_bounds_with_generic<T: BoundWithGeneric<u32>>(arg0: T, arg1: T)
where
T: BoundWithGeneric<u64>,
{
unimplemented!();
}
I saw this happen:
--> $DIR/trait_duplication_in_bounds.rs:16:32
+ |
+LL | fn good_bounds_with_generic<T: BoundWithGeneric<u32>>(arg0: T, arg1: T)
+ | ^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: consider removing this trait bound
I expected to see this happen:
No linting error as while the same trait is used, the concrete type argument it is applied to is different.
Version
rustc 1.62.0-nightly (8f36334ca 2022-04-06)
binary: rustc
commit-hash: 8f36334ca939a67cce3f37f24953ff6f2d3f3d33
commit-date: 2022-04-06
host: x86_64-apple-darwin
release: 1.62.0-nightly
LLVM version: 14.0.0