@@ -306,15 +306,14 @@ pub fn immediate_rvalue_bcx<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
306
306
/// caller can prove that either (1.) the code injected by `populate`
307
307
/// onto `bcx` always dominates the end of `scope`, or (2.) the data
308
308
/// 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 > ,
318
317
{
319
318
// Very subtle: potentially initialize the scratch memory at point where it is alloca'ed.
320
319
// (See discussion at Issue 30530.)
@@ -323,7 +322,7 @@ pub fn lvalue_scratch_datum<'blk, 'tcx, A, F>(bcx: Block<'blk, 'tcx>,
323
322
scope, Value ( scratch) , ty) ;
324
323
325
324
// Subtle. Populate the scratch memory *before* scheduling cleanup.
326
- let bcx = populate ( arg , bcx, scratch) ;
325
+ let bcx = populate ( bcx, scratch) ;
327
326
bcx. fcx . schedule_drop_mem ( scope, scratch, ty, None ) ;
328
327
329
328
DatumBlock :: new ( bcx, Datum :: new ( scratch, ty, Lvalue :: new ( "datum::lvalue_scratch_datum" ) ) )
@@ -517,14 +516,14 @@ impl<'tcx> Datum<'tcx, Rvalue> {
517
516
518
517
ByValue => {
519
518
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| {
522
521
debug ! ( "populate call for Datum::to_lvalue_datum_in_scope \
523
- self.ty={:?}", this . ty) ;
522
+ self.ty={:?}", self . ty) ;
524
523
// do not call_lifetime_start here; the
525
524
// `InitAlloc::Dropped` will start scratch
526
525
// value's lifetime at open of function body.
527
- let bcx = this . store_to ( bcx, llval) ;
526
+ let bcx = self . store_to ( bcx, llval) ;
528
527
bcx. fcx . schedule_lifetime_end ( scope, llval) ;
529
528
bcx
530
529
} )
0 commit comments