-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitAsyncAwait-PolishAsync-await issues that are part of the "polish" areaAsync-await issues that are part of the "polish" areaC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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
.
Metadata
Metadata
Assignees
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitAsyncAwait-PolishAsync-await issues that are part of the "polish" areaAsync-await issues that are part of the "polish" areaC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.