-
Notifications
You must be signed in to change notification settings - Fork 13.4k
ICE thread 'rustc' panicked at 'index out of bounds: the len is 8 but the index is 18446744073709551615' #41394
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Line 1710 in 467aaab
loop {
match self.variants[explicit_index].discr {
ty::VariantDiscr::Relative(0) => break,
ty::VariantDiscr::Relative(distance) => {
explicit_index -= distance;
}
ty::VariantDiscr::Explicit(expr_did) => {
match queries::monomorphic_const_eval::get(tcx, DUMMY_SP, expr_did) {
Ok(ConstVal::Integral(v)) => {
explicit_value = v;
break;
}
_ => {
explicit_index -= 1;
}
}
}
} |
@SimonSapin Do you get no error before this ICE? I see what I did wrong, but this can only be triggered by the first variant having an explicit discriminant which errored during evaluation. |
No other error, the output before what’s in the initial message is: % RUST_BACKTRACE=1 mach build
Compiling script v0.0.1 (file:///home/simon/servo1/components/script)
warning: variable does not need to be mutable
--> /home/simon/servo1/target/debug/build/script-9370d82a1d46a1f2/out/Bindings/MutationObserverBinding.rs:483:17
|
483 | let mut argc = 2;
| ^^^^^^^^
|
= note: #[warn(unused_mut)] on by default
error: internal compiler error: unexpected panic |
@eddyb are you looking at this? |
@arielb1 I'm pretty sure I know the fix but I fear that this is a different bug that trans hid before, and we'd hide again. I'm trying to get Servo people to find the |
Looks like |
Minimal testcase of the actual ICE bug (amusingly, it requires the fix for #23898 to trigger): enum Foo {
A = "" + 1
}
enum Bar {
A = Foo::A as isize
} |
rustc: generalize monomorphic_const_eval to polymorphic constants. With the addition of `Substs` to the query key, we can now evaluate *and cache* polymorphic constants. Fixes #23898 by replacing the crippled explicit-discriminant-only local-crate-only `lookup_variant_by_id` with `ConstVal::Variant` which can describe variants irrespective of their discriminant. Fixes #41394 by fixing #23898 (for the original testcase) and by not looping past the first discriminant.
Building Servo with rustc 1.18.0-nightly (467aaab 2017-04-19):
For what it’s worth, 18446744073709551615 is 0xFFFF_FFFF_FFFF_FFFF.
The text was updated successfully, but these errors were encountered: