You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
With #34980 (part of Rust 1.12.0) the error becomes:
error: Error loading target specification: Field data-layout in target specification is required
|
= help: Use `--print target-list` for a list of built-in targets
Which is exactly what would be expected and guides the user to the right solution.
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: