Closed
Description
#![feature(async_await, futures_api, await_macro)]
use std::future::Future;
async fn enter<'a, F, R>(mut callback: F)
where
F: FnMut(&'a mut i32) -> R,
R: Future<Output = ()> + 'a
{
unimplemented!()
}
error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
--> src/lib.rs:6:1
|
6 | where
| ^
|
note: hidden type `impl std::future::Future` captures the lifetime 'a as defined on the function body at 5:16
--> src/lib.rs:5:16
|
5 | async fn enter<'a, F, R>(mut callback: F)
| ^^
I think this is a bug? The RFC says
All of the input lifetimes to this function are captured in the future returned by the async function
so I'd expect the function to return impl Future<...> + 'a
.