-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Hitting “undefined reference to `core::future::identity_future’” when working with associated types and async #107557
Comments
@rustbot label T-compiler -regression-untriaged +regression-from-stable-to-stable For clarification (for prioritization): This regression happens between Of course, hitting such a linking error is a serious bug either way. Bisection looks like
|
Hm, I bet it's #89285 |
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-high |
seems the symbol names get normalized correctly with |
Hey folks, really appreciate you all looking at this. Is there any update? Anything I can do to assist? I'll admit the technical details of the failure here are beyond me though 😆 |
Out of curiosity, how does this look like today on nightly, now that |
This linker error happens with any generic function that takes the generator type. See, e.g., my minimized example: #![feature(generators)]
fn wrapper<T>(value: T) -> T {
value
}
fn func<T>() -> impl Sized {}
trait Trait<'a> {
type Assoc;
fn call() {
let _ = wrapper(|()| {
let _value = func::<Self::Assoc>();
yield;
});
}
}
impl Trait<'static> for () {
type Assoc = ();
}
fn main() {
<()>::call();
} |
I tried this code:
I expected to see this happen: The code would compile and link normally, and run
Instead, this happened: Compilation failed with the following linker error:
This failure seems to only occurs if the
fn call
is defined in the trait, and the trait must have a lifetime parameter.The above is a minimum reproducing case that LegionMammal978 managed to produce on the forums, based of a more convoluted reproducing case I originally had (playground link). They also produced a version that uses a generator to cause a similar linker failure (in nightly), with very similar setup (playground link) and pointed to PR 89285 as a possible suspect (based on bisecting the issue).
Let me know if any more information is needed, thanks!
Meta
rustc --version --verbose
:Also failed with nightly:
The text was updated successfully, but these errors were encountered: