librustc: Don't ICE on packed structs in statics.

This commit is contained in:
Luqman Aden 2013-10-12 21:42:24 -04:00
parent c6e3501da1
commit 4b4b2136e0

View File

@ -505,7 +505,12 @@ pub fn trans_const(ccx: &mut CrateContext, r: &Repr, discr: Disr,
}
Univariant(ref st, _dro) => {
assert_eq!(discr, 0);
C_struct(build_const_struct(ccx, st, vals))
let contents = build_const_struct(ccx, st, vals);
if st.packed {
C_packed_struct(contents)
} else {
C_struct(contents)
}
}
General(ref cases) => {
let case = &cases[discr];