rust/tests/ui/type-alias-impl-trait/wf_check_closures.rs

18 lines
310 B
Rust

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