@@ -274,9 +274,9 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> {
274
274
// move-path for the interior so it will be separate from
275
275
// the exterior.
276
276
self . create_move_path ( & place. clone ( ) . deref ( ) ) ;
277
- self . gather_init ( place, InitKind :: Shallow ) ;
277
+ self . gather_init ( place. as_place_ref ( ) , InitKind :: Shallow ) ;
278
278
} else {
279
- self . gather_init ( place, InitKind :: Deep ) ;
279
+ self . gather_init ( place. as_place_ref ( ) , InitKind :: Deep ) ;
280
280
}
281
281
self . gather_rvalue ( rval) ;
282
282
}
@@ -286,7 +286,7 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> {
286
286
StatementKind :: InlineAsm ( ref asm) => {
287
287
for ( output, kind) in asm. outputs . iter ( ) . zip ( & asm. asm . outputs ) {
288
288
if !kind. is_indirect {
289
- self . gather_init ( output, InitKind :: Deep ) ;
289
+ self . gather_init ( output. as_place_ref ( ) , InitKind :: Deep ) ;
290
290
}
291
291
}
292
292
for ( _, input) in asm. inputs . iter ( ) {
@@ -376,7 +376,7 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> {
376
376
TerminatorKind :: DropAndReplace { ref location, ref value, .. } => {
377
377
self . create_move_path ( location) ;
378
378
self . gather_operand ( value) ;
379
- self . gather_init ( location, InitKind :: Deep ) ;
379
+ self . gather_init ( location. as_place_ref ( ) , InitKind :: Deep ) ;
380
380
}
381
381
TerminatorKind :: Call {
382
382
ref func,
@@ -391,7 +391,7 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> {
391
391
}
392
392
if let Some ( ( ref destination, _bb) ) = * destination {
393
393
self . create_move_path ( destination) ;
394
- self . gather_init ( destination, InitKind :: NonPanicPathOnly ) ;
394
+ self . gather_init ( destination. as_place_ref ( ) , InitKind :: NonPanicPathOnly ) ;
395
395
}
396
396
}
397
397
}
@@ -426,35 +426,35 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> {
426
426
self . builder . data . loc_map [ self . loc ] . push ( move_out) ;
427
427
}
428
428
429
- fn gather_init ( & mut self , place : & Place < ' tcx > , kind : InitKind ) {
429
+ fn gather_init ( & mut self , place : PlaceRef < ' cx , ' tcx > , kind : InitKind ) {
430
430
debug ! ( "gather_init({:?}, {:?})" , self . loc, place) ;
431
431
432
432
let place = match place. projection {
433
433
// Check if we are assigning into a field of a union, if so, lookup the place
434
434
// of the union so it is marked as initialized again.
435
435
Some ( box Projection {
436
- base : ref proj_base,
436
+ base : proj_base,
437
437
elem : ProjectionElem :: Field ( _, _) ,
438
438
} ) => {
439
439
if let ty:: Adt ( def, _) =
440
- Place :: ty_from ( & place. base , proj_base, self . builder . body , self . builder . tcx )
440
+ Place :: ty_from ( place. base , proj_base, self . builder . body , self . builder . tcx )
441
441
. ty
442
442
. sty
443
443
{
444
444
if def. is_union ( ) {
445
- Place { base : place. base . clone ( ) , projection : proj_base. clone ( ) }
445
+ PlaceRef { base : place. base , projection : proj_base }
446
446
} else {
447
- place. clone ( )
447
+ place
448
448
}
449
449
} else {
450
- place. clone ( )
450
+ place
451
451
}
452
452
}
453
453
454
- _ => place. clone ( )
454
+ _ => place
455
455
} ;
456
456
457
- if let LookupResult :: Exact ( path) = self . builder . data . rev_lookup . find ( place. as_place_ref ( ) ) {
457
+ if let LookupResult :: Exact ( path) = self . builder . data . rev_lookup . find ( place) {
458
458
let init = self . builder . data . inits . push ( Init {
459
459
location : InitLocation :: Statement ( self . loc ) ,
460
460
path,
0 commit comments