Skip to content

Commit

Permalink
Turn some alloca_no_lifetime() calls into plain alloca() calls
Browse files Browse the repository at this point in the history
The issues that the comments referred to were fixed before the PR even
landed but we never got around to remove the hack of skipping the
lifetime start.
  • Loading branch information
dotdash committed Aug 25, 2015
1 parent 6e60fdb commit f3bd14a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/librustc_trans/trans/expr.rs
Expand Up @@ -247,8 +247,7 @@ pub fn trans<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
immediate_rvalue(load_ty(bcx, global, const_ty), const_ty)
} else {
let llty = type_of::type_of(bcx.ccx(), const_ty);
// HACK(eddyb) get around issues with lifetime intrinsics.
let scratch = alloca_no_lifetime(bcx, llty, "const");
let scratch = alloca(bcx, llty, "const");
let lldest = if !const_ty.is_structural() {
// Cast pointer to slot, because constants have different types.
PointerCast(bcx, scratch, val_ty(global))
Expand Down Expand Up @@ -412,8 +411,7 @@ fn apply_adjustments<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
let target = bcx.monomorphize(&target);
let llty = type_of::type_of(bcx.ccx(), target);

// HACK(eddyb) get around issues with lifetime intrinsics.
let scratch = alloca_no_lifetime(bcx, llty, "__coerce_target");
let scratch = alloca(bcx, llty, "__coerce_target");
let target_datum = Datum::new(scratch, target,
Rvalue::new(ByRef));
bcx = coerce_unsized(bcx, expr.span, source_datum, target_datum);
Expand Down

0 comments on commit f3bd14a

Please sign in to comment.