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
{
}
cc @xd009642 Any idea why this happens? Seems like the hashing of the types is missing the generics.
I'll have a look tonight but that seems the most likely scenario
So I can't see any parameters in Ty or TyKind for generic types associated with the type. There's 1rustc::hir::WhereBoundPredicate::bounded_generic_params` which maybe should be hashed? Provided that it's just the generics used in each bounded type. I'll have a play and see what I can do
rustc::hir::WhereBoundPredicate::bounded_generic_paramswhich maybe should be hashed
That sounds promising. Thanks for taking care of this!
I cannot reproduce this warning. Am I doing something wrong or the issue has gone?
I don't think this has been fixed: playground
Indeed, I cannot trigger this on my local Clippy test, I will figure out why
I cannot trigger this on my local Clippy test
I guess it's one of the following:
compiletest may ignore the warning, so you might be able to reproduce this by using #![deny(...)] instead of #![warn(...)].master but not yet released.Yes I just fixed it, something went wrong with deny/warn and my eyes.
Note: the problem is still here.