-
Notifications
You must be signed in to change notification settings - Fork 13.3k
LLVM error with trait objects #47638
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
Comments
Mentioning @michaelwoerister @eddyb @nagisa who touched librustc_trans recently (disclaimer: I don't know if that's where this problem would come from but it sounds relevant). |
cc @pnkfelix @nikomatsakis Is this one of those "HRTB lifetimes in |
triage: P-high We need to figure this out. |
So, I was testing nightly toolchains and this has been a problem since:
The code compiles OK with previous day's nightly:
|
5041b3b...33374fa then, almost certainly something in #45225. @eddyb |
@dtolnay I introduced it for this specific case, yeah, but it's a long-standing bug AFAICT (#36744). |
So I agree with @eddyb that it's the same bug. I think my preferred longer term fix is to change our rules around subtyping and higher-ranked regions -- but in the short term, I suspect we need some bit casts. |
This is not a new regression in its general case, only specifically trait objects outside of structs: struct Newtype<T>(T);
fn id<'c, 'b>(f: &'c Newtype<&'b Fn(&i32)>) -> &'c Newtype<&'b Fn(&'static i32)> {
f
}
fn main() {
let f: &Fn(&i32) = &|x| {};
id(&Newtype(f));
} This fails with the LLVM error in 1.0 through 1.22, according to godbolt. |
rustc_trans: keep LLVM types for trait objects anonymous. Fixes rust-lang#47638 by reverting the addition of readable LLVM trait object type names. r? @nikomatsakis
The following code
gives the following error on beta (1.24) and nightly (1.25 2018-01-17). It compiles successfully on stable.
The text was updated successfully, but these errors were encountered: