auto merge of #6848 : pcwalton/rust/issue-6352, r=pcwalton
r? @nikomatsakis
This commit is contained in:
commit
6fcb483609
@ -563,6 +563,7 @@ fn build_const_struct(ccx: @CrateContext, st: &Struct, vals: &[ValueRef])
|
||||
vals[i]
|
||||
};
|
||||
cfields.push(val);
|
||||
offset += machine::llsize_of_alloc(ccx, llty) as u64
|
||||
}
|
||||
|
||||
return cfields;
|
||||
|
14
src/test/run-pass/const-struct-offsets.rs
Normal file
14
src/test/run-pass/const-struct-offsets.rs
Normal file
@ -0,0 +1,14 @@
|
||||
enum Foo {
|
||||
IntVal(i32),
|
||||
Int64Val(i64)
|
||||
}
|
||||
|
||||
struct Bar {
|
||||
i: i32,
|
||||
v: Foo
|
||||
}
|
||||
|
||||
static bar: Bar = Bar { i: 0, v: IntVal(0) };
|
||||
|
||||
fn main() {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user