Closed
Description
While exploring building a cross-compiler and running the test suite on it, I found the following issue:
Using a config.toml
with:
host = ["x86_64-unknown-linux-gnu", "i686-unknown-linux-gnu"]
target = ["x86_64-unknown-linux-gnu", "i686-unknown-linux-gnu"]
and then doing x.py test
eventually hits this problem:
./build/i686-unknown-linux-gnu/stage1/bin/rustc --target=x86_64-unknown-linux-gnu -O /tmp/huge-enum.rs
warning: unused variable: `big`
--> /tmp/huge-enum.rs:23:9
|
23 | let big: Option<[u32; (1<<45)-1]> = None;
| ^^^ help: consider using `_big` instead
|
= note: #[warn(unused_variables)] on by default
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `4294967295`,
right: `35184372088831`', src/librustc_target/abi/mod.rs:716:17
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: internal compiler error: unexpected panic
The reason for this ICE is due to a mistake in rustc
's internal API here:
rust/src/librustc_target/abi/mod.rs
Lines 710 to 721 in 6d34ec1
As @nagisa points out on Zulip, the compiler should not be using usize
except for its own indices "and other memory-ey things"