Skip to content

Commit 19533b4

Browse files
committed
---
yaml --- r: 44139 b: refs/heads/snap-stage3 c: e8732bd h: refs/heads/master i: 44137: fae1313 44135: 497f79a v: v3
1 parent 3aa790a commit 19533b4

File tree

7 files changed

+150
-204
lines changed

7 files changed

+150
-204
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 19dfec2aaf746535de1521f68421f9980dbf25de
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 7c34908e69d6cd51e3764f0be63a7a74484d6fe2
4+
refs/heads/snap-stage3: e8732bde5ebc29ea69cc7d2c1637490d26424b2d
55
refs/heads/try: ef355f6332f83371e4acf04fc4eb940ab41d78d3
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/trans/type_of.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -328,20 +328,11 @@ pub fn type_of(cx: @crate_ctxt, t: ty::t) -> TypeRef {
328328
pub fn enum_body_types(cx: @crate_ctxt, did: ast::def_id, t: ty::t)
329329
-> ~[TypeRef] {
330330
let univar = ty::enum_is_univariant(cx.tcx, did);
331+
let size = machine::static_size_of_enum(cx, t);
331332
if !univar {
332-
let size = machine::static_size_of_enum(cx, t);
333333
~[T_enum_discrim(cx), T_array(T_i8(), size)]
334-
}
335-
else {
336-
// Use the actual fields, so we get the alignment right.
337-
match ty::get(t).sty {
338-
ty::ty_enum(_, ref substs) => {
339-
do ty::enum_variants(cx.tcx, did)[0].args.map |&field_ty| {
340-
sizing_type_of(cx, ty::subst(cx.tcx, substs, field_ty))
341-
}
342-
}
343-
_ => cx.sess.bug(~"enum is not an enum")
344-
}
334+
} else {
335+
~[T_array(T_i8(), size)]
345336
}
346337
}
347338

0 commit comments

Comments
 (0)