Skip to content

Commit dace146

Browse files
committed
---
yaml --- r: 282017 b: refs/heads/stable c: bd0a849 h: refs/heads/master i: 282015: 255d87d
1 parent 0d911ae commit dace146

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: 3c795e08d6f4a532f12f3f8e1837db5e0647f8b0
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 03993882d634b923d9f8e467b7a991f3b07b6453
32+
refs/heads/stable: bd0a849f3b0fcc88743dc8d29cf69dd983ed5dbc
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/src/librustc_trans/trans/adt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,7 @@ pub fn trans_drop_flag_ptr<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
12771277
let scratch = unpack_datum!(bcx, datum::lvalue_scratch_datum(
12781278
bcx, tcx.dtor_type(), "drop_flag",
12791279
InitAlloca::Uninit("drop flag itself has no dtor"),
1280-
cleanup::CustomScope(custom_cleanup_scope), (), |_, bcx, _| {
1280+
cleanup::CustomScope(custom_cleanup_scope), |bcx, _| {
12811281
debug!("no-op populate call for trans_drop_flag_ptr on dtor_type={:?}",
12821282
tcx.dtor_type());
12831283
bcx

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

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -306,15 +306,14 @@ pub fn immediate_rvalue_bcx<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
306306
/// caller can prove that either (1.) the code injected by `populate`
307307
/// onto `bcx` always dominates the end of `scope`, or (2.) the data
308308
/// being allocated has no associated destructor.
309-
pub fn lvalue_scratch_datum<'blk, 'tcx, A, F>(bcx: Block<'blk, 'tcx>,
310-
ty: Ty<'tcx>,
311-
name: &str,
312-
zero: InitAlloca,
313-
scope: cleanup::ScopeId,
314-
arg: A,
315-
populate: F)
316-
-> DatumBlock<'blk, 'tcx, Lvalue> where
317-
F: FnOnce(A, Block<'blk, 'tcx>, ValueRef) -> Block<'blk, 'tcx>,
309+
pub fn lvalue_scratch_datum<'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>,
310+
ty: Ty<'tcx>,
311+
name: &str,
312+
zero: InitAlloca,
313+
scope: cleanup::ScopeId,
314+
populate: F)
315+
-> DatumBlock<'blk, 'tcx, Lvalue> where
316+
F: FnOnce(Block<'blk, 'tcx>, ValueRef) -> Block<'blk, 'tcx>,
318317
{
319318
// Very subtle: potentially initialize the scratch memory at point where it is alloca'ed.
320319
// (See discussion at Issue 30530.)
@@ -323,7 +322,7 @@ pub fn lvalue_scratch_datum<'blk, 'tcx, A, F>(bcx: Block<'blk, 'tcx>,
323322
scope, Value(scratch), ty);
324323

325324
// Subtle. Populate the scratch memory *before* scheduling cleanup.
326-
let bcx = populate(arg, bcx, scratch);
325+
let bcx = populate(bcx, scratch);
327326
bcx.fcx.schedule_drop_mem(scope, scratch, ty, None);
328327

329328
DatumBlock::new(bcx, Datum::new(scratch, ty, Lvalue::new("datum::lvalue_scratch_datum")))
@@ -517,14 +516,14 @@ impl<'tcx> Datum<'tcx, Rvalue> {
517516

518517
ByValue => {
519518
lvalue_scratch_datum(
520-
bcx, self.ty, name, InitAlloca::Dropped, scope, self,
521-
|this, bcx, llval| {
519+
bcx, self.ty, name, InitAlloca::Dropped, scope,
520+
|bcx, llval| {
522521
debug!("populate call for Datum::to_lvalue_datum_in_scope \
523-
self.ty={:?}", this.ty);
522+
self.ty={:?}", self.ty);
524523
// do not call_lifetime_start here; the
525524
// `InitAlloc::Dropped` will start scratch
526525
// value's lifetime at open of function body.
527-
let bcx = this.store_to(bcx, llval);
526+
let bcx = self.store_to(bcx, llval);
528527
bcx.fcx.schedule_lifetime_end(scope, llval);
529528
bcx
530529
})

0 commit comments

Comments
 (0)