-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Compile error: static lifetime not satisfied but it is #86172
Comments
@rustbot label +A-lifetimes +E-needs-mcve +T-compiler |
I cannot minimize further: use std::{future::Future, pin::Pin};
trait Foo: Send + Sync {
type F: Future<Output = ()> + Send + 'static;
}
impl<R: Foo + ?Sized> Foo for Box<R> {
type F = R::F;
}
fn a<R: Foo>() -> R::F { todo!() }
async fn b<R: Foo>() {
a::<R>().await
}
fn c() -> impl Future<Output = ()> + Send {
type A = Box<dyn Foo<F = Pin<Box<dyn Future<Output = ()> + Send + 'static>>>>;
Box::pin(async {
b::<A>().await;
})
} @rustbot label -E-needs-mcve |
I bisected using the above repro to find the regression in nightly-2020-10-07. cargo-bisect-rustc reports 6 bors merge commits:
Looking through those my best guess is that this is caused by #73905. This suggests it is different from #80052 as I don't believe it has ever compiled, and it definitely works on both sides of this regression. |
Assigning priority as discussed in the Zulip thread of the Prioritization Working Group. @rustbot label -I-prioritize +P-high |
So removing the |
I recommend that this be first handed off to wg-async to investigate, with the advice that they in turn should feel free to hand it off again to T-types if they determine that this isn't really async/generator specific. |
I tried this code:
Playground
I expected to see this to compile fine, minor changes to the code cause it to compile.
Instead, I get this error:
This may be a duplicate of #80052 but as it involves no associated constants I'm keeping it separate for now.
Compiled with rustc 1.52.1
The text was updated successfully, but these errors were encountered: