// [no_self_infer] check-pass // compile-flags: -Ztrait-solver=next // revisions: self_infer no_self_infer // checks that the new solver is smart enough to infer `?0 = U` when solving: // `normalizes-to( as Trait>::Assoc, u8)` // with `normalizes-to( as Trait>::Assoc, u8)` in the paramenv even when // there is a separate `Vec: Trait` bound in the paramenv. // // FIXME(-Ztrait-solver=next) // This could also compile for `normalizes-to(::Assoc, u8)` but // we currently immediately consider a goal ambiguous if the self type is an // inference variable. trait Trait { type Assoc; } fn foo>(x: T) {} #[cfg(self_infer)] fn unconstrained() -> T { todo!() } #[cfg(no_self_infer)] fn unconstrained() -> Vec { todo!() } fn bar() where Vec: Trait, Vec: Trait, { foo(unconstrained()) //[self_infer]~^ ERROR type annotations needed } fn main() {}