@@ -119,7 +119,8 @@ pub fn elaborate_drop<'b, 'tcx, D>(
119
119
}
120
120
121
121
impl < ' l , ' b , ' tcx , D > DropCtxt < ' l , ' b , ' tcx , D >
122
- where D : DropElaborator < ' b , ' tcx >
122
+ where
123
+ D : DropElaborator < ' b , ' tcx > ,
123
124
{
124
125
fn place_ty ( & self , place : & Place < ' tcx > ) -> Ty < ' tcx > {
125
126
place. ty ( self . elaborator . body ( ) , self . tcx ( ) ) . ty
@@ -285,12 +286,12 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D>
285
286
///
286
287
/// NOTE: this does not clear the master drop flag, so you need
287
288
/// to point succ/unwind on a `drop_ladder_bottom`.
288
- fn drop_ladder ( & mut self ,
289
- fields : Vec < ( Place < ' tcx > , Option < D :: Path > ) > ,
290
- succ : BasicBlock ,
291
- unwind : Unwind )
292
- -> ( BasicBlock , Unwind )
293
- {
289
+ fn drop_ladder (
290
+ & mut self ,
291
+ fields : Vec < ( Place < ' tcx > , Option < D :: Path > ) > ,
292
+ succ : BasicBlock ,
293
+ unwind : Unwind ,
294
+ ) -> ( BasicBlock , Unwind ) {
294
295
debug ! ( "drop_ladder({:?}, {:?})" , self , fields) ;
295
296
296
297
let mut fields = fields;
@@ -314,9 +315,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D>
314
315
( * normal_ladder. last ( ) . unwrap ( ) , * unwind_ladder. last ( ) . unwrap ( ) )
315
316
}
316
317
317
- fn open_drop_for_tuple ( & mut self , tys : & [ Ty < ' tcx > ] )
318
- -> BasicBlock
319
- {
318
+ fn open_drop_for_tuple ( & mut self , tys : & [ Ty < ' tcx > ] ) -> BasicBlock {
320
319
debug ! ( "open_drop_for_tuple({:?}, {:?})" , self , tys) ;
321
320
322
321
let fields = tys. iter ( ) . enumerate ( ) . map ( |( i, & ty) | {
@@ -328,9 +327,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D>
328
327
self . drop_ladder ( fields, succ, unwind) . 0
329
328
}
330
329
331
- fn open_drop_for_box ( & mut self , adt : & ' tcx ty:: AdtDef , substs : SubstsRef < ' tcx > )
332
- -> BasicBlock
333
- {
330
+ fn open_drop_for_box ( & mut self , adt : & ' tcx ty:: AdtDef , substs : SubstsRef < ' tcx > ) -> BasicBlock {
334
331
debug ! ( "open_drop_for_box({:?}, {:?}, {:?})" , self , adt, substs) ;
335
332
336
333
let interior = self . place . clone ( ) . deref ( ) ;
@@ -346,8 +343,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D>
346
343
self . drop_subpath ( & interior, interior_path, succ, unwind_succ)
347
344
}
348
345
349
- fn open_drop_for_adt ( & mut self , adt : & ' tcx ty:: AdtDef , substs : SubstsRef < ' tcx > )
350
- -> BasicBlock {
346
+ fn open_drop_for_adt ( & mut self , adt : & ' tcx ty:: AdtDef , substs : SubstsRef < ' tcx > ) -> BasicBlock {
351
347
debug ! ( "open_drop_for_adt({:?}, {:?}, {:?})" , self , adt, substs) ;
352
348
if adt. variants . len ( ) == 0 {
353
349
return self . elaborator . patch ( ) . new_block ( BasicBlockData {
@@ -505,9 +501,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D>
505
501
self . drop_flag_test_block ( switch_block, succ, unwind)
506
502
}
507
503
508
- fn destructor_call_block ( & mut self , ( succ, unwind) : ( BasicBlock , Unwind ) )
509
- -> BasicBlock
510
- {
504
+ fn destructor_call_block ( & mut self , ( succ, unwind) : ( BasicBlock , Unwind ) ) -> BasicBlock {
511
505
debug ! ( "destructor_call_block({:?}, {:?})" , self , succ) ;
512
506
let tcx = self . tcx ( ) ;
513
507
let drop_trait = tcx. lang_items ( ) . drop_trait ( ) . unwrap ( ) ;
@@ -837,11 +831,12 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D>
837
831
/// if FLAG(self.path)
838
832
/// if let Some(mode) = mode: FLAG(self.path)[mode] = false
839
833
/// drop(self.place)
840
- fn complete_drop ( & mut self ,
841
- drop_mode : Option < DropFlagMode > ,
842
- succ : BasicBlock ,
843
- unwind : Unwind ) -> BasicBlock
844
- {
834
+ fn complete_drop (
835
+ & mut self ,
836
+ drop_mode : Option < DropFlagMode > ,
837
+ succ : BasicBlock ,
838
+ unwind : Unwind ,
839
+ ) -> BasicBlock {
845
840
debug ! ( "complete_drop({:?},{:?})" , self , drop_mode) ;
846
841
847
842
let drop_block = self . drop_block ( succ, unwind) ;
@@ -892,7 +887,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D>
892
887
adt : & ' tcx ty:: AdtDef ,
893
888
substs : SubstsRef < ' tcx > ,
894
889
target : BasicBlock ,
895
- unwind : Unwind
890
+ unwind : Unwind ,
896
891
) -> BasicBlock {
897
892
let tcx = self . tcx ( ) ;
898
893
let unit_temp = Place :: Base ( PlaceBase :: Local ( self . new_temp ( tcx. mk_unit ( ) ) ) ) ;
@@ -947,11 +942,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D>
947
942
}
948
943
}
949
944
950
- fn new_block ( & mut self ,
951
- unwind : Unwind ,
952
- k : TerminatorKind < ' tcx > )
953
- -> BasicBlock
954
- {
945
+ fn new_block ( & mut self , unwind : Unwind , k : TerminatorKind < ' tcx > ) -> BasicBlock {
955
946
self . elaborator . patch ( ) . new_block ( BasicBlockData {
956
947
statements : vec ! [ ] ,
957
948
terminator : Some ( Terminator {
0 commit comments