Skip to content

Commit d827ce0

Browse files
committed
---
yaml --- r: 45018 b: refs/heads/master c: 40313fb h: refs/heads/master v: v3
1 parent 3e6636f commit d827ce0

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,5 +1,5 @@
11
---
2-
refs/heads/master: fdd28451f68a14916c57c50baa045132316cedc6
2+
refs/heads/master: 40313fb6b0104f703c06b2dd46198ad1f15d267b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d9689399d091c3265f00434a69c551a61c28dc
55
refs/heads/try: ef355f6332f83371e4acf04fc4eb940ab41d78d3

trunk/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)