f
fn futSize: a a a
f
fn futв🧇
impl TraitAV
T: 'staticAE
8 | fn test<T>(t: T) -> Pin<Box<dyn Future<Output = ()> + 'static>> {
| - help: consider adding an explicit lifetime bound...: `T: 'static`в🧇
T вообще никак не участвует в результатеr
fn futfn fut<'a, T:'a >(_: T) -> impl Future<Output = ()> + 'static + 'a {
async {
}
}f
AV
T вообще никак не участвует в результатев🧇
8 | fn test<T>(t: T) -> Pin<Box<dyn Future<Output = ()> + 'static>> {
| - help: consider adding an explicit lifetime bound...: `T: 'static`fn fut<T>(_: T) -> impl Future<Output = ()> + 'static;
Она (насколько я вижу) возвращает всегда :'static значение. T тут не должен влиять.в🧇
в🧇
fn fut<'a, T:'a >(_: T) -> impl Future<Output = ()> + 'static + 'a {
async {
}
}'a и не меньше 'static. То-же самое как и + 'a + 'bf
fn fut<T>(_: T) -> BoxFuture<'static, ()> {
Box::pin(std::future::ready(()))
}f
fn fut<T>(_: T) -> BoxFuture<'static, ()> {
Box::pin(async {})
}в🧇
impl Trait видимо ¯\_(ツ)_/¯AV
impl Trait видимо ¯\_(ツ)_/¯AV
в🧇
AV
f