-
Notifications
You must be signed in to change notification settings - Fork 634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
“expected bound lifetime parameter, found concrete lifetime” with 'static
across await point
#1199
Comments
'static
across await point
Just found another simpler reproducer: same version of #![feature(async_await, await_macro, futures_api)]
use futures::future;
use std::any::Any;
async fn send(msg: Box<Any + Send + 'static>) -> () {
await!(future::lazy(move |_| {
msg;
()
}))
} Now I'm thinking this is likely a problem in rustc, so cc'ing rust-lang/rust#50547 |
Also, it reproduces only when the |
It looks like this is an issue specific to async/await: when I have this, it reproduces (playground link) #![feature(generators, async_await, futures_api)]
use std::any::Any;
async fn send(msg: Box<Any + 'static>) -> () {
let mut pinned = move || { msg; () };
yield
} (interestingly, with But with this (trying to reproduce with generators only), it compiles as expected: (playground link) #![feature(generators, generator_trait)]
use std::any::Any;
use std::ops::Generator;
fn send(msg: Box<Any + 'static>) -> impl Generator + 'static {
|| {
let mut pinned = move || { msg; () };
yield
}
} |
The specificity of #![feature(generators, async_await, futures_api)]
use std::any::Any;
trait Trait {}
async fn send(msg: Box<Trait + 'static>) -> () {
let mut pinned = move || { msg; () };
yield
} And this does not: (playground) #![feature(generators, async_await, futures_api)]
use std::any::Any;
trait Trait: 'static {}
async fn send(msg: Box<Trait + 'static>) -> () {
let mut pinned = move || { msg; () };
yield
} |
Closing for moving this issue to rust-lang/rust#53548. |
ISSUE MOVED TO rust-lang/rust#53548
(edit: simpler reproducer without channels at #1199 (comment))
On the currently-latest commit of
futures-rs
(c02ec75), with the currently-latest nightly (2018-08-14), the following code does not build:It fails with the following error:
I can't figure out the reason why it fails, so I'm assuming it's something in
futures-rs
. But maybe it's actually a rustc bug from async/await? Or maybe it's just me missing something obvious, actually :)The text was updated successfully, but these errors were encountered: