2023-07-18 11:07:42 -05:00
|
|
|
// compile-flags: -Ztrait-solver=next
|
2023-07-20 03:40:59 -05:00
|
|
|
// check-pass
|
2023-07-18 11:07:42 -05:00
|
|
|
|
|
|
|
// Checks that we do not get ambiguity by considering an impl
|
|
|
|
// multiple times if we're able to normalize the self type.
|
2023-07-20 03:40:59 -05:00
|
|
|
|
2023-07-18 11:07:42 -05:00
|
|
|
trait Trait<'a> {}
|
|
|
|
|
|
|
|
impl<'a, T: 'a> Trait<'a> for T {}
|
|
|
|
|
|
|
|
fn impls_trait<'a, T: Trait<'a>>() {}
|
|
|
|
|
|
|
|
trait Id {
|
|
|
|
type Assoc;
|
|
|
|
}
|
|
|
|
impl<T> Id for T {
|
|
|
|
type Assoc = T;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn call<T>() {
|
|
|
|
impls_trait::<<T as Id>::Assoc>();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
call::<()>();
|
|
|
|
impls_trait::<<<() as Id>::Assoc as Id>::Assoc>();
|
|
|
|
}
|