Skip to content

Misleading error caused by incorrect target specification #34806

Closed
@whitequark

Description

@whitequark

Using rustc 1.10.0-dev (cfcb716 2016-07-03), and the following specification (it's incomplete, but that's irrelevant):

{
  "llvm-target": "or1k-unknown-none",
  "target-endian": "little",
  "target-pointer-width": 32
}

This is the error I get:

error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
thread 'rustc' panicked at 'Field target-pointer-width in target specification is required', ../src/librustc_back/target/mod.rs:377
note: Run with `RUST_BACKTRACE=1` for a backtrace.

It's an ICE, which is a bit more scary than it ought to be, but that's fine. What's not fine is that it says there's no target-pointer-width but really what it doesn't like is that the value is not a string. Took me a while.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions