//@ compile-flags: -Znext-solver //@ check-pass // Exercises the ambiguity that comes from replacing the associated types within the bounds // that are required for a `impl Trait for dyn Trait` built-in object impl to hold. trait Sup { type Assoc; } trait Foo: Sup + Sup { type Other: Bar<>::Assoc>; } trait Bar {} impl Bar for () {} fn foo(x: &(impl Foo + ?Sized)) {} fn main() { let x: &dyn Foo<_, _, Other = ()> = todo!(); foo(x); let y: &dyn Foo = x; }