You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
async: hidden type for impl Trait captures lifetime that does not appear in bounds #59001
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.
@Matthias247 that's strange. The playground appears broken currently, but when I compile that locally with the latest nightly I still get the original error.
Marking this as blocking as it is part of the lifetime refactoring work that @cramertj has already started doing and should be addressed by that (as discussed here).
Activity
csmoe commentedon Mar 8, 2019
lifetime'ais not needed here cc https://github.com/rust-lang/rfcs/blob/master/text/2394-async_await.md#lifetime-capture-in-the-anonymous-futurehttps://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=722ade51ac1bae6363b13f83ea246f5ejethrogb commentedon Mar 8, 2019
@csmoe what do you mean "not needed"? You changed the signature of the function.
Matthias247 commentedon Mar 10, 2019
@jethrogb This compiles for me on on playground.
jethrogb commentedon Mar 10, 2019
@Matthias247 that's strange. The playground appears broken currently, but when I compile that locally with the latest nightly I still get the original error.
csmoe commentedon Mar 11, 2019
cc @cramertj
cramertj commentedon Mar 11, 2019
Yes, this is a bug I'm currently working on fixing.
nikomatsakis commentedon Mar 12, 2019
Marking this as blocking as it is part of the lifetime refactoring work that @cramertj has already started doing and should be addressed by that (as discussed here).
Auto merge of #59286 - cramertj:async-fn-ret-ty, r=varkor
Rollup merge of rust-lang#59286 - cramertj:async-fn-ret-ty, r=varkor