]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/issues/issue-67830.rs
Merge commit '266e96785ab71834b917bf474f130a6d8fdecd4b' into sync_cg_clif-2022-10-23
[rust.git] / src / test / ui / impl-trait / issues / issue-67830.rs
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() {}