-
-
Notifications
You must be signed in to change notification settings - Fork 90
Closed
Labels
Description
I tried to produce a MRE:
#[async_trait]
pub trait MapInto<T>: Future {
async fn map_into(self) -> T
where Self: Sized;
}
#[async_trait]
impl<F, T> MapInto<T> for F
where F: ?Sized,
F: Future + Send,
T: From<F::Output>,
{
async fn map_into(self) -> T
where Self: Sized,
{
self.await.into()
}
}
error:
error[E0309]: the parameter type `T` may not live long enough
--> src/future.rs:116:1
|
116 | #[async_trait]
| ^^^^^^^^^^^^^^
117 | impl<F, T> MapInto<T> for F
| - help: consider adding an explicit lifetime bound `T: 'async_trait`...
|
A fix for me: T: 'static, in impl block. Is it a bug?