@@ -100,7 +100,7 @@ where
100
100
101
101
source_info : SourceInfo ,
102
102
103
- place : & ' l Place < ' tcx > ,
103
+ place : Place < ' tcx > ,
104
104
path : D :: Path ,
105
105
succ : BasicBlock ,
106
106
unwind : Unwind ,
@@ -109,7 +109,7 @@ where
109
109
pub fn elaborate_drop < ' b , ' tcx , D > (
110
110
elaborator : & mut D ,
111
111
source_info : SourceInfo ,
112
- place : & Place < ' tcx > ,
112
+ place : Place < ' tcx > ,
113
113
path : D :: Path ,
114
114
succ : BasicBlock ,
115
115
unwind : Unwind ,
@@ -126,7 +126,7 @@ where
126
126
D : DropElaborator < ' b , ' tcx > ,
127
127
' tcx : ' b ,
128
128
{
129
- fn place_ty ( & self , place : & Place < ' tcx > ) -> Ty < ' tcx > {
129
+ fn place_ty ( & self , place : Place < ' tcx > ) -> Ty < ' tcx > {
130
130
place. ty ( self . elaborator . body ( ) , self . tcx ( ) ) . ty
131
131
}
132
132
@@ -168,7 +168,7 @@ where
168
168
self . elaborator . patch ( ) . patch_terminator (
169
169
bb,
170
170
TerminatorKind :: Drop {
171
- location : * self . place ,
171
+ location : self . place ,
172
172
target : self . succ ,
173
173
unwind : self . unwind . into_option ( ) ,
174
174
} ,
@@ -195,7 +195,7 @@ where
195
195
/// (the move path is `None` if the field is a rest field).
196
196
fn move_paths_for_fields (
197
197
& self ,
198
- base_place : & Place < ' tcx > ,
198
+ base_place : Place < ' tcx > ,
199
199
variant_path : D :: Path ,
200
200
variant : & ' tcx ty:: VariantDef ,
201
201
substs : SubstsRef < ' tcx > ,
@@ -219,7 +219,7 @@ where
219
219
220
220
fn drop_subpath (
221
221
& mut self ,
222
- place : & Place < ' tcx > ,
222
+ place : Place < ' tcx > ,
223
223
path : Option < D :: Path > ,
224
224
succ : BasicBlock ,
225
225
unwind : Unwind ,
@@ -267,12 +267,10 @@ where
267
267
) -> Vec < BasicBlock > {
268
268
Some ( succ)
269
269
. into_iter ( )
270
- . chain ( fields. iter ( ) . rev ( ) . zip ( unwind_ladder) . map (
271
- |( & ( ref place, path) , & unwind_succ) | {
272
- succ = self . drop_subpath ( place, path, succ, unwind_succ) ;
273
- succ
274
- } ,
275
- ) )
270
+ . chain ( fields. iter ( ) . rev ( ) . zip ( unwind_ladder) . map ( |( & ( place, path) , & unwind_succ) | {
271
+ succ = self . drop_subpath ( place, path, succ, unwind_succ) ;
272
+ succ
273
+ } ) )
276
274
. collect ( )
277
275
}
278
276
@@ -315,7 +313,7 @@ where
315
313
debug ! ( "drop_ladder({:?}, {:?})" , self , fields) ;
316
314
317
315
let mut fields = fields;
318
- fields. retain ( |& ( ref place, _) | {
316
+ fields. retain ( |& ( place, _) | {
319
317
self . place_ty ( place) . needs_drop ( self . tcx ( ) , self . elaborator . param_env ( ) )
320
318
} ) ;
321
319
@@ -364,7 +362,7 @@ where
364
362
let unwind_succ =
365
363
self . unwind . map ( |unwind| self . box_free_block ( adt, substs, unwind, Unwind :: InCleanup ) ) ;
366
364
367
- self . drop_subpath ( & interior, interior_path, succ, unwind_succ)
365
+ self . drop_subpath ( interior, interior_path, succ, unwind_succ)
368
366
}
369
367
370
368
fn open_drop_for_adt ( & mut self , adt : & ' tcx ty:: AdtDef , substs : SubstsRef < ' tcx > ) -> BasicBlock {
@@ -439,8 +437,7 @@ where
439
437
self . place . clone ( ) ,
440
438
ProjectionElem :: Downcast ( Some ( variant. ident . name ) , variant_index) ,
441
439
) ;
442
- let fields =
443
- self . move_paths_for_fields ( & base_place, variant_path, & variant, substs) ;
440
+ let fields = self . move_paths_for_fields ( base_place, variant_path, & variant, substs) ;
444
441
values. push ( discr. val ) ;
445
442
if let Unwind :: To ( unwind) = unwind {
446
443
// We can't use the half-ladder from the original
@@ -527,7 +524,7 @@ where
527
524
// way lies only trouble.
528
525
let discr_ty = adt. repr . discr_type ( ) . to_ty ( self . tcx ( ) ) ;
529
526
let discr = Place :: from ( self . new_temp ( discr_ty) ) ;
530
- let discr_rv = Rvalue :: Discriminant ( * self . place ) ;
527
+ let discr_rv = Rvalue :: Discriminant ( self . place ) ;
531
528
let switch_block = BasicBlockData {
532
529
statements : vec ! [ self . assign( & discr, discr_rv) ] ,
533
530
terminator : Some ( Terminator {
@@ -564,7 +561,7 @@ where
564
561
Rvalue :: Ref (
565
562
tcx. lifetimes. re_erased,
566
563
BorrowKind :: Mut { allow_two_phase_borrow: false } ,
567
- * self . place,
564
+ self . place,
568
565
) ,
569
566
) ] ,
570
567
terminator : Some ( Terminator {
@@ -712,7 +709,7 @@ where
712
709
let base_block = BasicBlockData {
713
710
statements : vec ! [
714
711
self . assign( elem_size, Rvalue :: NullaryOp ( NullOp :: SizeOf , ety) ) ,
715
- self . assign( len, Rvalue :: Len ( * self . place) ) ,
712
+ self . assign( len, Rvalue :: Len ( self . place) ) ,
716
713
] ,
717
714
is_cleanup : self . unwind . is_cleanup ( ) ,
718
715
terminator : Some ( Terminator {
@@ -761,7 +758,7 @@ where
761
758
// cur = tmp as *mut T;
762
759
// end = Offset(cur, len);
763
760
vec ! [
764
- self . assign( & tmp, Rvalue :: AddressOf ( Mutability :: Mut , * self . place) ) ,
761
+ self . assign( & tmp, Rvalue :: AddressOf ( Mutability :: Mut , self . place) ) ,
765
762
self . assign( & cur, Rvalue :: Cast ( CastKind :: Misc , Operand :: Move ( tmp) , iter_ty) ) ,
766
763
self . assign(
767
764
& length_or_end,
@@ -935,7 +932,7 @@ where
935
932
936
933
fn drop_block ( & mut self , target : BasicBlock , unwind : Unwind ) -> BasicBlock {
937
934
let block =
938
- TerminatorKind :: Drop { location : * self . place , target, unwind : unwind. into_option ( ) } ;
935
+ TerminatorKind :: Drop { location : self . place , target, unwind : unwind. into_option ( ) } ;
939
936
self . new_block ( unwind, block)
940
937
}
941
938
0 commit comments