//@ revisions: current next //@ ignore-compare-mode-next-solver (explicit revisions) //@[next] compile-flags: -Znext-solver // A regression test for #105787 #![feature(type_alias_impl_trait)] pub type Alias = impl Sized; #[define_opaque(Alias)] pub fn cast(x: Container, T>) -> Container { //[next]~^ ERROR type annotations needed x } struct Container, U> { x: >::Assoc, } trait Trait { type Assoc; } impl Trait for T { type Assoc = Box; } impl Trait for Alias { //~^ ERROR conflicting implementations of trait type Assoc = usize; } fn main() { let x: Box = cast::<()>(Container { x: 0 }).x; println!("{}", *x); }