@@ -218,26 +218,26 @@ impl<'tcx> HasMoveData<'tcx> for EverInitializedPlaces<'_, 'tcx> {
218
218
219
219
impl < ' a , ' tcx > MaybeInitializedPlaces < ' a , ' tcx > {
220
220
fn update_bits (
221
- trans : & mut <Self as Analysis < ' tcx > >:: Domain ,
221
+ state : & mut <Self as Analysis < ' tcx > >:: Domain ,
222
222
path : MovePathIndex ,
223
- state : DropFlagState ,
223
+ dfstate : DropFlagState ,
224
224
) {
225
- match state {
226
- DropFlagState :: Absent => trans . kill ( path) ,
227
- DropFlagState :: Present => trans . gen_ ( path) ,
225
+ match dfstate {
226
+ DropFlagState :: Absent => state . kill ( path) ,
227
+ DropFlagState :: Present => state . gen_ ( path) ,
228
228
}
229
229
}
230
230
}
231
231
232
232
impl < ' tcx > MaybeUninitializedPlaces < ' _ , ' tcx > {
233
233
fn update_bits (
234
- trans : & mut <Self as Analysis < ' tcx > >:: Domain ,
234
+ state : & mut <Self as Analysis < ' tcx > >:: Domain ,
235
235
path : MovePathIndex ,
236
- state : DropFlagState ,
236
+ dfstate : DropFlagState ,
237
237
) {
238
- match state {
239
- DropFlagState :: Absent => trans . gen_ ( path) ,
240
- DropFlagState :: Present => trans . kill ( path) ,
238
+ match dfstate {
239
+ DropFlagState :: Absent => state . gen_ ( path) ,
240
+ DropFlagState :: Present => state . kill ( path) ,
241
241
}
242
242
}
243
243
}
@@ -265,12 +265,12 @@ impl<'tcx> Analysis<'tcx> for MaybeInitializedPlaces<'_, 'tcx> {
265
265
266
266
fn apply_statement_effect (
267
267
& mut self ,
268
- trans : & mut Self :: Domain ,
268
+ state : & mut Self :: Domain ,
269
269
statement : & mir:: Statement < ' tcx > ,
270
270
location : Location ,
271
271
) {
272
272
drop_flag_effects_for_location ( self . body , self . move_data , location, |path, s| {
273
- Self :: update_bits ( trans , path, s)
273
+ Self :: update_bits ( state , path, s)
274
274
} ) ;
275
275
276
276
// Mark all places as "maybe init" if they are mutably borrowed. See #90752.
@@ -282,7 +282,7 @@ impl<'tcx> Analysis<'tcx> for MaybeInitializedPlaces<'_, 'tcx> {
282
282
&& let LookupResult :: Exact ( mpi) = self . move_data ( ) . rev_lookup . find ( place. as_ref ( ) )
283
283
{
284
284
on_all_children_bits ( self . move_data ( ) , mpi, |child| {
285
- trans . gen_ ( child) ;
285
+ state . gen_ ( child) ;
286
286
} )
287
287
}
288
288
}
@@ -309,7 +309,7 @@ impl<'tcx> Analysis<'tcx> for MaybeInitializedPlaces<'_, 'tcx> {
309
309
310
310
fn apply_call_return_effect (
311
311
& mut self ,
312
- trans : & mut Self :: Domain ,
312
+ state : & mut Self :: Domain ,
313
313
_block : mir:: BasicBlock ,
314
314
return_places : CallReturnPlaces < ' _ , ' tcx > ,
315
315
) {
@@ -320,7 +320,7 @@ impl<'tcx> Analysis<'tcx> for MaybeInitializedPlaces<'_, 'tcx> {
320
320
self . move_data ( ) ,
321
321
self . move_data ( ) . rev_lookup . find ( place. as_ref ( ) ) ,
322
322
|mpi| {
323
- trans . gen_ ( mpi) ;
323
+ state . gen_ ( mpi) ;
324
324
} ,
325
325
) ;
326
326
} ) ;
@@ -345,7 +345,7 @@ impl<'tcx> Analysis<'tcx> for MaybeInitializedPlaces<'_, 'tcx> {
345
345
} ;
346
346
347
347
let mut discriminants = enum_def. discriminants ( self . tcx ) ;
348
- edge_effects. apply ( |trans , edge| {
348
+ edge_effects. apply ( |state , edge| {
349
349
let Some ( value) = edge. value else {
350
350
return ;
351
351
} ;
@@ -363,7 +363,7 @@ impl<'tcx> Analysis<'tcx> for MaybeInitializedPlaces<'_, 'tcx> {
363
363
self . move_data ( ) ,
364
364
enum_place,
365
365
variant,
366
- |mpi| trans . kill ( mpi) ,
366
+ |mpi| state . kill ( mpi) ,
367
367
) ;
368
368
} ) ;
369
369
}
@@ -383,7 +383,7 @@ impl<'tcx> Analysis<'tcx> for MaybeUninitializedPlaces<'_, 'tcx> {
383
383
MixedBitSet :: new_empty ( self . move_data ( ) . move_paths . len ( ) )
384
384
}
385
385
386
- // sets on_entry bits for Arg places
386
+ // sets state bits for Arg places
387
387
fn initialize_start_block ( & self , _: & mir:: Body < ' tcx > , state : & mut Self :: Domain ) {
388
388
// set all bits to 1 (uninit) before gathering counter-evidence
389
389
state. insert_all ( ) ;
@@ -396,12 +396,12 @@ impl<'tcx> Analysis<'tcx> for MaybeUninitializedPlaces<'_, 'tcx> {
396
396
397
397
fn apply_statement_effect (
398
398
& mut self ,
399
- trans : & mut Self :: Domain ,
399
+ state : & mut Self :: Domain ,
400
400
_statement : & mir:: Statement < ' tcx > ,
401
401
location : Location ,
402
402
) {
403
403
drop_flag_effects_for_location ( self . body , self . move_data , location, |path, s| {
404
- Self :: update_bits ( trans , path, s)
404
+ Self :: update_bits ( state , path, s)
405
405
} ) ;
406
406
407
407
// Unlike in `MaybeInitializedPlaces` above, we don't need to change the state when a
@@ -410,12 +410,12 @@ impl<'tcx> Analysis<'tcx> for MaybeUninitializedPlaces<'_, 'tcx> {
410
410
411
411
fn apply_terminator_effect < ' mir > (
412
412
& mut self ,
413
- trans : & mut Self :: Domain ,
413
+ state : & mut Self :: Domain ,
414
414
terminator : & ' mir mir:: Terminator < ' tcx > ,
415
415
location : Location ,
416
416
) -> TerminatorEdges < ' mir , ' tcx > {
417
417
drop_flag_effects_for_location ( self . body , self . move_data , location, |path, s| {
418
- Self :: update_bits ( trans , path, s)
418
+ Self :: update_bits ( state , path, s)
419
419
} ) ;
420
420
if self . skip_unreachable_unwind . contains ( location. block ) {
421
421
let mir:: TerminatorKind :: Drop { target, unwind, .. } = terminator. kind else { bug ! ( ) } ;
@@ -428,7 +428,7 @@ impl<'tcx> Analysis<'tcx> for MaybeUninitializedPlaces<'_, 'tcx> {
428
428
429
429
fn apply_call_return_effect (
430
430
& mut self ,
431
- trans : & mut Self :: Domain ,
431
+ state : & mut Self :: Domain ,
432
432
_block : mir:: BasicBlock ,
433
433
return_places : CallReturnPlaces < ' _ , ' tcx > ,
434
434
) {
@@ -439,7 +439,7 @@ impl<'tcx> Analysis<'tcx> for MaybeUninitializedPlaces<'_, 'tcx> {
439
439
self . move_data ( ) ,
440
440
self . move_data ( ) . rev_lookup . find ( place. as_ref ( ) ) ,
441
441
|mpi| {
442
- trans . kill ( mpi) ;
442
+ state . kill ( mpi) ;
443
443
} ,
444
444
) ;
445
445
} ) ;
@@ -468,7 +468,7 @@ impl<'tcx> Analysis<'tcx> for MaybeUninitializedPlaces<'_, 'tcx> {
468
468
} ;
469
469
470
470
let mut discriminants = enum_def. discriminants ( self . tcx ) ;
471
- edge_effects. apply ( |trans , edge| {
471
+ edge_effects. apply ( |state , edge| {
472
472
let Some ( value) = edge. value else {
473
473
return ;
474
474
} ;
@@ -486,7 +486,7 @@ impl<'tcx> Analysis<'tcx> for MaybeUninitializedPlaces<'_, 'tcx> {
486
486
self . move_data ( ) ,
487
487
enum_place,
488
488
variant,
489
- |mpi| trans . gen_ ( mpi) ,
489
+ |mpi| state . gen_ ( mpi) ,
490
490
) ;
491
491
} ) ;
492
492
}
@@ -512,10 +512,10 @@ impl<'tcx> Analysis<'tcx> for EverInitializedPlaces<'_, 'tcx> {
512
512
}
513
513
}
514
514
515
- #[ instrument( skip( self , trans ) , level = "debug" ) ]
515
+ #[ instrument( skip( self , state ) , level = "debug" ) ]
516
516
fn apply_statement_effect (
517
517
& mut self ,
518
- trans : & mut Self :: Domain ,
518
+ state : & mut Self :: Domain ,
519
519
stmt : & mir:: Statement < ' tcx > ,
520
520
location : Location ,
521
521
) {
@@ -525,7 +525,7 @@ impl<'tcx> Analysis<'tcx> for EverInitializedPlaces<'_, 'tcx> {
525
525
let rev_lookup = & move_data. rev_lookup ;
526
526
527
527
debug ! ( "initializes move_indexes {:?}" , init_loc_map[ location] ) ;
528
- trans . gen_all ( init_loc_map[ location] . iter ( ) . copied ( ) ) ;
528
+ state . gen_all ( init_loc_map[ location] . iter ( ) . copied ( ) ) ;
529
529
530
530
if let mir:: StatementKind :: StorageDead ( local) = stmt. kind {
531
531
// End inits for StorageDead, so that an immutable variable can
@@ -535,15 +535,15 @@ impl<'tcx> Analysis<'tcx> for EverInitializedPlaces<'_, 'tcx> {
535
535
"clears the ever initialized status of {:?}" ,
536
536
init_path_map[ move_path_index]
537
537
) ;
538
- trans . kill_all ( init_path_map[ move_path_index] . iter ( ) . copied ( ) ) ;
538
+ state . kill_all ( init_path_map[ move_path_index] . iter ( ) . copied ( ) ) ;
539
539
}
540
540
}
541
541
}
542
542
543
- #[ instrument( skip( self , trans , terminator) , level = "debug" ) ]
543
+ #[ instrument( skip( self , state , terminator) , level = "debug" ) ]
544
544
fn apply_terminator_effect < ' mir > (
545
545
& mut self ,
546
- trans : & mut Self :: Domain ,
546
+ state : & mut Self :: Domain ,
547
547
terminator : & ' mir mir:: Terminator < ' tcx > ,
548
548
location : Location ,
549
549
) -> TerminatorEdges < ' mir , ' tcx > {
@@ -552,7 +552,7 @@ impl<'tcx> Analysis<'tcx> for EverInitializedPlaces<'_, 'tcx> {
552
552
let init_loc_map = & move_data. init_loc_map ;
553
553
debug ! ( ?term) ;
554
554
debug ! ( "initializes move_indexes {:?}" , init_loc_map[ location] ) ;
555
- trans . gen_all (
555
+ state . gen_all (
556
556
init_loc_map[ location]
557
557
. iter ( )
558
558
. filter ( |init_index| {
@@ -565,7 +565,7 @@ impl<'tcx> Analysis<'tcx> for EverInitializedPlaces<'_, 'tcx> {
565
565
566
566
fn apply_call_return_effect (
567
567
& mut self ,
568
- trans : & mut Self :: Domain ,
568
+ state : & mut Self :: Domain ,
569
569
block : mir:: BasicBlock ,
570
570
_return_places : CallReturnPlaces < ' _ , ' tcx > ,
571
571
) {
@@ -574,7 +574,7 @@ impl<'tcx> Analysis<'tcx> for EverInitializedPlaces<'_, 'tcx> {
574
574
575
575
let call_loc = self . body . terminator_loc ( block) ;
576
576
for init_index in & init_loc_map[ call_loc] {
577
- trans . gen_ ( * init_index) ;
577
+ state . gen_ ( * init_index) ;
578
578
}
579
579
}
580
580
}
0 commit comments