#![feature(type_alias_impl_trait)] trait Bar { fn bar(&self); } type FooFn = impl FnOnce(); fn foo(bar: B) -> FooFn { move || { bar.bar() } //~^ ERROR the trait bound `B: Bar` is not satisfied } fn main() { let boom: FooFn = unsafe { core::mem::zeroed() }; boom(); }