]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/unboxed-closures/issue-30906.rs
1 #![feature(fn_traits, unboxed_closures)]
4 // ignore-compare-mode-nll
5 //[nll] compile-flags: -Z borrowck=mir
7 fn test
<F
: for<'x
> FnOnce
<(&'x
str,)>>(_
: F
) {}
9 struct Compose
<F
, G
>(F
, G
);
10 impl<T
, F
, G
> FnOnce
<(T
,)> for Compose
<F
, G
>
13 G
: FnOnce
<(F
::Output
,)>,
15 type Output
= G
::Output
;
16 extern "rust-call" fn call_once(self, (x
,): (T
,)) -> G
::Output
{
21 fn bad
<T
>(f
: fn(&'
static str) -> T
) {
22 test(Compose(f
, |_
| {}
));
23 //~^ ERROR: implementation of `FnOnce` is not general enough