-
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
Compiler panics when 'data-layout' field is missing in LLVM target json #33497
Comments
cardoe
added a commit
to cardoe/rust
that referenced
this issue
Jul 27, 2016
Change all the target generation functions to return a Result<Target, String> so that targets that are unable to be instantiated can be expressed as an Err instead of a panic!(). This should improve rust-lang#33497 as well.
This should likely improve with #34980. |
This can probably be closed now. With #34980 (part of Rust 1.12.0) the error becomes:
Which is exactly what would be expected and guides the user to the right solution. |
Yay! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I upgraded my compiler to the most recent nightly, I found that my project no longer compiles. Instead, rustc panics, producing this error:
As the panic message indicates, the target I was supplying was missing the 'data-layout' field:
I added
"data-layout": "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"
to the target, and everything builds once again. The requirement that this field be present apparently is caused by a change in LLVM, according to this issue: #31367. It looks like this was fixed for all of the targets rust uses internally by this change: #32939.Since targets can be supplied by the user, as in the case above, panicking doesn't really seem warranted. Panicking implies there is a bug in the compiler, whereas the problem might be in the user's input. If the problem is in the user's input, it would be nice for the error to indicate this, to prevent confusion.
The text was updated successfully, but these errors were encountered: