// compile-flags: -Ztrait-solver=next // check that when computing `alias-eq(<() as Foo>::Assoc, <() as Foo>::Assoc)` // we do not infer `?0 = u8` via the `for (): Foo` impl or `?0 = u16` by // relating substs as either could be a valid solution. trait Foo { type Assoc; } impl Foo for () where (): Foo, { type Assoc = <() as Foo>::Assoc; } impl Foo for () { type Assoc = u8; } impl Foo for () { type Assoc = u16; } fn output() -> <() as Foo>::Assoc where (): Foo, { todo!() } fn incomplete() where (): Foo, { // `<() as Foo>::Assoc == <() as Foo<_, STOP>>::Assoc` let _: <() as Foo>::Assoc = output::<_, T>(); //~^ error: type annotations needed // let _: <() as Foo>::Assoc = output::(); // OK // let _: <() as Foo>::Assoc = output::(); // OK } fn main() {}