2022-02-17 07:55:58 -06:00
|
|
|
trait MyFn<Arg> {
|
|
|
|
type Output;
|
|
|
|
fn call(&self, arg: Arg) -> Self::Output;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Wrap<F>(F);
|
|
|
|
|
|
|
|
impl<A, B, F> MyFn<A> for Wrap<F>
|
|
|
|
where
|
|
|
|
F: Fn(A) -> B
|
|
|
|
{
|
|
|
|
type Output = B;
|
|
|
|
|
|
|
|
fn call(&self, arg: A) -> Self::Output {
|
|
|
|
(self.0)(arg)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
struct A;
|
|
|
|
fn test() -> impl for<'a> MyFn<&'a A, Output=impl Iterator + 'a> {
|
2022-05-14 04:25:53 -05:00
|
|
|
//~^ ERROR higher kinded lifetime bounds on nested opaque types are not supported yet
|
2022-02-17 07:55:58 -06:00
|
|
|
Wrap(|a| Some(a).into_iter())
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|