Skip to content

Commit 077bc18

Browse files
committed
---
yaml --- r: 232760 b: refs/heads/try c: 9a15d66 h: refs/heads/master v: v3
1 parent 097901a commit 077bc18

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
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: edeb4f1c86cbf6af8ef9874d4b3af50f721ea1b8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: 727a5d543d662231224002c3345f78b0bebf8c6b
4+
refs/heads/try: 9a15d664a67137028bb0d32eab56698b18356e6d
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/librustc_trans/trans/datum.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,7 @@ pub fn lvalue_scratch_datum<'blk, 'tcx, A, F>(bcx: Block<'blk, 'tcx>,
304304
let scratch = alloc_ty(bcx, ty, name);
305305

306306
// Subtle. Populate the scratch memory *before* scheduling cleanup.
307-
call_lifetime_start(bcx, scratch);
308307
let bcx = populate(arg, bcx, scratch);
309-
bcx.fcx.schedule_lifetime_end(scope, scratch);
310308
bcx.fcx.schedule_drop_mem(scope, scratch, ty, None);
311309

312310
DatumBlock::new(bcx, Datum::new(scratch, ty, Lvalue::new("datum::lvalue_scratch_datum")))
@@ -499,7 +497,12 @@ impl<'tcx> Datum<'tcx, Rvalue> {
499497
ByValue => {
500498
lvalue_scratch_datum(
501499
bcx, self.ty, name, scope, self,
502-
|this, bcx, llval| this.store_to(bcx, llval))
500+
|this, bcx, llval| {
501+
call_lifetime_start(bcx, llval);
502+
let bcx = this.store_to(bcx, llval);
503+
bcx.fcx.schedule_lifetime_end(scope, llval);
504+
bcx
505+
})
503506
}
504507
}
505508
}

0 commit comments

Comments
 (0)