// 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 Foo { type FooFn: FnOnce(); fn foo(&self, bar: B) -> Self::FooFn; } struct MyFoo; impl Foo for MyFoo { type FooFn = impl FnOnce(); fn foo(&self, bar: B) -> Self::FooFn { move || bar.bar() //~ ERROR: the trait bound `B: Bar` is not satisfied } } fn main() { let boom: ::FooFn = unsafe { core::mem::zeroed() }; boom(); }