Hi! I’m looking for help regarding the error message “async fn return type cannot contain a projection or Self that references lifetimes from a parent scope”. AFAICT from searching the forum there is only one other mention of this error message (“How to wrap async stream (for a library)?”), but in that thread, the solution is to change an occurrence of Self
to the underlying type. In my case, I get this error on a free function, there is no Self
involved, and I’m not sure what to do about it. Does anyone have any ideas?
trait MyTrait<'a> {
type Output;
}
async fn my_function<'a, T: MyTrait<'a>>(input: T) -> T::Output {
todo!();
}
Thanks!