// check-pass // Regression test for issue #57611 // Ensures that we don't ICE #![feature(trait_alias)] #![feature(type_alias_impl_trait)] trait Foo { type Bar: Baz; fn bar(&self) -> Self::Bar; } struct X; impl Foo for X { type Bar = impl Baz; fn bar(&self) -> Self::Bar { |x| x } } trait Baz = Fn(&A) -> &B; fn main() {}