]> git.proxmox.com Git - rustc.git/blob - src/test/ui/type-alias-impl-trait/wf_check_closures.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / type-alias-impl-trait / wf_check_closures.rs
1 #![feature(type_alias_impl_trait)]
2
3 trait Bar {
4 fn bar(&self);
5 }
6
7 type FooFn<B> = impl FnOnce();
8
9 fn foo<B: Bar>(bar: B) -> FooFn<B> {
10 move || { bar.bar() }
11 //~^ ERROR the trait bound `B: Bar` is not satisfied
12 }
13
14 fn main() {
15 let boom: FooFn<u32> = unsafe { core::mem::zeroed() };
16 boom();
17 }