trait Trait {
type Assoc<'a>
where
Self: 'a;
}
impl<T> Trait for T {
type Assoc<'a> = ()
where
Self: 'a;
}
async fn inner<'a, T: Trait + 'a>(_: T, x: T::Assoc<'a>) -> T::Assoc<'a> {
std::future::ready(x).await
}
async fn outer<'a>() {
let x = 1u32;
inner(&x, ()).await;
}
fn is_send<T: Send>(_: T) {}
fn main() {
is_send(outer())
}
this results in
error: implementation of `Send` is not general enough
--> src/main.rs:25:5
|
25 | is_send(outer())
| ^^^^^^^^^^^^^^^^ implementation of `Send` is not general enough
|
= note: `Send` would have to be implemented for the type `&'0 u32`, for any lifetime `'0`...
= note: ...but `Send` is actually implemented for the type `&'1 u32`, for some specific lifetime `'1`
fixing the underlying issue may still take a while, we should at least point to the source of the coroutine which introduces that '0 and '1 in the error, i.e. I expect that we can fairly easily point at the body of inner here
this results in
fixing the underlying issue may still take a while, we should at least point to the source of the coroutine which introduces that
'0and'1in the error, i.e. I expect that we can fairly easily point at the body ofinnerhere