]>
Commit | Line | Data |
---|---|---|
ee023bcb FG |
1 | trait MyFn<Arg> { |
2 | type Output; | |
3 | fn call(&self, arg: Arg) -> Self::Output; | |
4 | } | |
5 | ||
6 | struct Wrap<F>(F); | |
7 | ||
8 | impl<A, B, F> MyFn<A> for Wrap<F> | |
9 | where | |
10 | F: Fn(A) -> B | |
11 | { | |
12 | type Output = B; | |
13 | ||
14 | fn call(&self, arg: A) -> Self::Output { | |
15 | (self.0)(arg) | |
16 | } | |
17 | } | |
18 | ||
19 | ||
20 | struct A; | |
21 | fn test() -> impl for<'a> MyFn<&'a A, Output=impl Iterator + 'a> { | |
22 | //~^ ERROR higher kinded lifetime bounds on nested opaque types are not supported yet | |
23 | Wrap(|a| Some(a).into_iter()) | |
24 | } | |
25 | ||
26 | fn main() {} |