//@ check-pass //@ compile-flags: --crate-type=lib //@ revisions: current next //@ ignore-compare-mode-next-solver (explicit revisions) //@[next] compile-flags: -Znext-solver // Since #120752, also get alias-bound candidates from a nested self-type, so prefering // alias-bound over where-bound candidates can be incorrect. This test checks that case and that // we prefer non-nested alias-bound candidates over where-bound candidates over nested alias-bound // candidates. trait OtherTrait<'a> { type Assoc: ?Sized; } trait Trait where >::Assoc: Sized, { type Assoc: for<'a> OtherTrait<'a>; } fn impls_sized() {} fn foo<'a, T>() where T: Trait, for<'hr> >::Assoc: Sized, { impls_sized::<>::Assoc>(); }