]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/wf-check-fn-def.rs
Rollup merge of #106446 - bzEq:fix-unwind-lsda, r=Amanieu
[rust.git] / tests / ui / type-alias-impl-trait / wf-check-fn-def.rs
1 #![feature(type_alias_impl_trait)]
2
3 trait Bar {
4     fn bar(&self);
5 }
6
7 type FooFn<B> = impl FnOnce(B);
8
9 fn foo<B: Bar>() -> FooFn<B> {
10     fn mop<B: Bar>(bar: B) { bar.bar() }
11     mop // NOTE: no function pointer, but function zst item
12     //~^ ERROR the trait bound `B: Bar` is not satisfied
13 }
14
15 fn main() {
16     let boom: FooFn<u32> = unsafe { core::mem::zeroed() };
17     boom(42);
18 }