Consider the following minimized example (playground link):
pub struct Struct<T, A: WithAssoc<T = T>> {
field: A,
}
pub trait WithAssoc {
type T;
}
pub trait Trait<T> {}
pub trait Trait2<T> {}
impl<A: WithAssoc> Trait<A::T> for Struct<A::T, A> {}
//conflicting implementation?
// impl<A: WithAssoc> Trait<&A::T> for Struct<A::T, A> {}
impl<T, A: WithAssoc<T = T>> Trait2<T> for Struct<T, A> {}
impl<T, A: WithAssoc<T = T>> Trait2<&T> for Struct<T, A> {}
The first version produces an error about conflicting implementations while the second version compiles fine. As far as I understand the two ways of writing these two impl's should be equivalent. Is this a bug or shortcoming in the trait solver or am I misunderstanding something?