Skip to content

Commit 6fcb483

Browse files
committed
auto merge of #6848 : pcwalton/rust/issue-6352, r=pcwalton
r? @nikomatsakis
2 parents 7272743 + 40b4557 commit 6fcb483

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/librustc/middle/trans/adt.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,7 @@ fn build_const_struct(ccx: @CrateContext, st: &Struct, vals: &[ValueRef])
563563
vals[i]
564564
};
565565
cfields.push(val);
566+
offset += machine::llsize_of_alloc(ccx, llty) as u64
566567
}
567568

568569
return cfields;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
enum Foo {
2+
IntVal(i32),
3+
Int64Val(i64)
4+
}
5+
6+
struct Bar {
7+
i: i32,
8+
v: Foo
9+
}
10+
11+
static bar: Bar = Bar { i: 0, v: IntVal(0) };
12+
13+
fn main() {}
14+

0 commit comments

Comments
 (0)