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