rust
rust copied to clipboard
ICE const value has different size than its type
The following test yields an ICE in trans
enum Foo {
IntVal(i32),
Int64Val(i64)
}
struct Bar {
i: i32,
v: Foo
}
static bar: Bar = Bar { i: 0, v: IntVal(0) };
fn main() {}
{ i32, { i32, i32, [8 x i8] } } { i32 0, { i32, i32, [8 x i8] } { i32 0, i32 0, [8 x i8] undef } } { i32, { i32, i64, [0 x i8] } } undef error: internal compiler error: const expr(29: Bar{i: 0, v: IntVal(0),}) of type Bar has size 20 instead of 24
This error appears on arm target. and probably can appear on x86-32bit machine.
This problem occurs while compiling servo for ARM target
{ i8*, { i32, i32, [8 x i8] } } { i8* getelementptr inbounds ([5 x i8]* @const55, i32 0, i32 0), { i32, i32, [8 x i8] } { i32 0, i32 0, [8 x i8] undef } } { i8*, { i32, double, [0 x i8] } } undef
error: internal compiler error: const expr(28945: ConstantSpec{name: &NONE_name as u8 as *libc::c_char, value: IntVal(0),}) of type dom::bindings::utils::ConstantSpec has size 20 instead of 24
rust: task failed at 'explicit failure', /home/aydin.kim/servo/webconv/arm_arranged/src/rust/src/libsyntax/diagnostic.rs:92
rust: task failed at 'explicit failure', /home/aydin.kim/servo/webconv/arm_arranged/src/rust/src/librustc/rustc.rc:349
rust: domain main @0x1d20410 root task failed
make: ** [servo] Error 101
cc @jld, I think this is your code?
Compiles fine on x86 32bit machine.
Fixed.
Thanks!