// Regression test for #90400, // taken from https://github.com/rust-lang/rust/issues/90400#issuecomment-954927836 #![feature(type_alias_impl_trait)] trait Bar { fn bar(&self); } trait Baz { fn baz(&self); } trait Foo { type FooFn: Baz; fn foo(&self, bar: B) -> Self::FooFn; } struct MyFoo; impl Foo for MyFoo { type FooFn = impl Baz; fn foo(&self, bar: B) -> Self::FooFn { MyBaz(bar) //~ ERROR: the trait bound `B: Bar` is not satisfied } } struct MyBaz(B); impl Baz for MyBaz { fn baz(&self) {} } fn main() { let boom: ::FooFn = unsafe { core::mem::zeroed() }; boom.baz(); }