Skip to content

Commit f3bd14a

Browse files
committed
Turn some alloca_no_lifetime() calls into plain alloca() calls
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.
1 parent 6e60fdb commit f3bd14a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/librustc_trans/trans/expr.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,7 @@ pub fn trans<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
247247
immediate_rvalue(load_ty(bcx, global, const_ty), const_ty)
248248
} else {
249249
let llty = type_of::type_of(bcx.ccx(), const_ty);
250-
// HACK(eddyb) get around issues with lifetime intrinsics.
251-
let scratch = alloca_no_lifetime(bcx, llty, "const");
250+
let scratch = alloca(bcx, llty, "const");
252251
let lldest = if !const_ty.is_structural() {
253252
// Cast pointer to slot, because constants have different types.
254253
PointerCast(bcx, scratch, val_ty(global))
@@ -412,8 +411,7 @@ fn apply_adjustments<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
412411
let target = bcx.monomorphize(&target);
413412
let llty = type_of::type_of(bcx.ccx(), target);
414413

415-
// HACK(eddyb) get around issues with lifetime intrinsics.
416-
let scratch = alloca_no_lifetime(bcx, llty, "__coerce_target");
414+
let scratch = alloca(bcx, llty, "__coerce_target");
417415
let target_datum = Datum::new(scratch, target,
418416
Rvalue::new(ByRef));
419417
bcx = coerce_unsized(bcx, expr.span, source_datum, target_datum);

0 commit comments

Comments
 (0)