diff options
Diffstat (limited to 'tests/ui/type-alias-impl-trait/wf_check_closures.rs')
-rw-r--r-- | tests/ui/type-alias-impl-trait/wf_check_closures.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/type-alias-impl-trait/wf_check_closures.rs b/tests/ui/type-alias-impl-trait/wf_check_closures.rs new file mode 100644 index 000000000..2c70696ff --- /dev/null +++ b/tests/ui/type-alias-impl-trait/wf_check_closures.rs @@ -0,0 +1,17 @@ +#![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(); +} |