]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/type-alias-impl-trait/wf-check-fn-ptrs.rs
1 #![feature(type_alias_impl_trait)]
9 type FooFn
<B
> = impl FnOnce(B
);
11 fn foo
<B
: Bar
>() -> FooFn
<B
> {
12 fn mop
<B
: Bar
>(bar
: B
) { bar.bar() }
14 // function pointers don't have any obligations on them,
15 // thus the above compiles. It's obviously unsound to just
16 // procure a `FooFn` from the ether without making sure that
17 // the pointer is actually legal for all `B`
21 let boom
: FooFn
<u32> = unsafe { core::mem::zeroed() }
;