//@ 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)] mod defining_scope { use super::*; pub type Alias = impl Sized; 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 defining_scope::Alias { //~^ ERROR conflicting implementations of trait type Assoc = usize; } fn main() { let x: Box = defining_scope::cast::<()>(Container { x: 0 }).x; println!("{}", *x); }