Closed SimonSapin closed 7 years ago
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;
}
}
}
}
This whole method was added in https://github.com/rust-lang/rust/pull/41310. CC @eddyb
@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 enum
with 8 variants and explicit discriminant(s).
Looks like ValueTag::INT32
fails to evaluate without producing an error. JSValueType::JSVAL_TYPE_INT32
is just 1
so the evaluation should have succeeded.
Oh, evaluation fails because of #23898 - which I've accidentally extended the incidence of. I've fixed it on a branch, guess that will be the fix for this bug as well, just need @est31 to confirm.
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
}
Building Servo with rustc 1.18.0-nightly (467aaab50 2017-04-19):
For what it’s worth, 18446744073709551615 is 0xFFFF_FFFF_FFFF_FFFF.