Skip to content

Commit 5ab9f84

Browse files
committed
---
yaml --- r: 48510 b: refs/heads/snap-stage3 c: 40313fb h: refs/heads/master v: v3
1 parent cc0f98d commit 5ab9f84

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
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: 3bbcac322669cff3abde5be937cc4ec3860f3985
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: fdd28451f68a14916c57c50baa045132316cedc6
4+
refs/heads/snap-stage3: 40313fb6b0104f703c06b2dd46198ad1f15d267b
55
refs/heads/try: 2a8fb58d79e685d5ca07b039badcf2ae3ef077ea
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -722,14 +722,12 @@ fn trans_def_dps_unadjusted(bcx: block, ref_expr: @ast::expr,
722722
let fn_data = callee::trans_fn_ref(bcx, vid, ref_expr.id);
723723
Store(bcx, fn_data.llfn, lldest);
724724
return bcx;
725-
} else if !ty::enum_is_univariant(ccx.tcx, tid) {
726-
// Nullary variant.
727-
let lldiscrimptr = GEPi(bcx, lldest, [0u, 0u]);
728-
let lldiscrim = C_int(bcx.ccx(), variant_info.disr_val);
729-
Store(bcx, lldiscrim, lldiscrimptr);
730-
return bcx;
731725
} else {
732-
// Nullary univariant.
726+
// Nullary variant.
727+
let ty = expr_ty(bcx, ref_expr);
728+
let repr = adt::represent_type(ccx, ty);
729+
adt::trans_set_discr(bcx, &repr, lldest,
730+
variant_info.disr_val);
733731
return bcx;
734732
}
735733
}

0 commit comments

Comments
 (0)