diff options
| author | Andrew Cann <shum@canndrew.org> | 2016-08-01 14:44:29 +0800 |
|---|---|---|
| committer | Andrew Cann <shum@canndrew.org> | 2016-08-13 21:37:09 +0800 |
| commit | 0e1c2aa52e7ec3f162ab4436c2ed0746d1992109 (patch) | |
| tree | 936d07908fe50847cfcb315249e809ddf78daff0 | |
| parent | ba65d2e15b45c639e9a77407585644eafedc172c (diff) | |
| download | rust-0e1c2aa52e7ec3f162ab4436c2ed0746d1992109.tar.gz rust-0e1c2aa52e7ec3f162ab4436c2ed0746d1992109.zip | |
Make AdjustEmptyToAny actually perform the adjustment
| -rw-r--r-- | src/librustc_trans/expr.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustc_trans/expr.rs b/src/librustc_trans/expr.rs index 059532957b8..fa2521205a8 100644 --- a/src/librustc_trans/expr.rs +++ b/src/librustc_trans/expr.rs @@ -381,11 +381,11 @@ fn apply_adjustments<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, debug!("unadjusted datum for expr {:?}: {:?} adjustment={:?}", expr, datum, adjustment); match adjustment { - AdjustEmptyToAny(..) => { - let const_ty = expr_ty(bcx, expr); - let llty = type_of::type_of(bcx.ccx(), const_ty); + AdjustEmptyToAny(ref target) => { + let mono_target = bcx.monomorphize(target); + let llty = type_of::type_of(bcx.ccx(), mono_target); let dummy = C_undef(llty.ptr_to()); - datum = Datum::new(dummy, const_ty, Rvalue::new(ByRef)).to_expr_datum(); + datum = Datum::new(dummy, mono_target, Rvalue::new(ByRef)).to_expr_datum(); } AdjustReifyFnPointer => { match datum.ty.sty { |
