@@ -17,7 +17,7 @@ use super::super::MoveDataParamEnv;
1717use super :: super :: DropFlagState ;
1818use super :: super :: drop_flag_effects_for_function_entry;
1919use super :: super :: drop_flag_effects_for_location;
20- use super :: super :: on_all_children_bits ;
20+ use super :: super :: on_lookup_result_bits ;
2121
2222use super :: { BitDenotation , BlockSets , DataflowOperator } ;
2323
@@ -277,10 +277,9 @@ impl<'a, 'tcx> BitDenotation for MaybeInitializedLvals<'a, 'tcx> {
277277 dest_lval : & repr:: Lvalue ) {
278278 // when a call returns successfully, that means we need to set
279279 // the bits for that dest_lval to 1 (initialized).
280- let move_path_index = ctxt. move_data . rev_lookup . find ( dest_lval) ;
281- on_all_children_bits ( self . tcx , self . mir , & ctxt. move_data ,
282- move_path_index,
283- |mpi| { in_out. add ( & mpi) ; } ) ;
280+ on_lookup_result_bits ( self . tcx , self . mir , & ctxt. move_data ,
281+ ctxt. move_data . rev_lookup . find ( dest_lval) ,
282+ |mpi| { in_out. add ( & mpi) ; } ) ;
284283 }
285284}
286285
@@ -338,11 +337,10 @@ impl<'a, 'tcx> BitDenotation for MaybeUninitializedLvals<'a, 'tcx> {
338337 _dest_bb : repr:: BasicBlock ,
339338 dest_lval : & repr:: Lvalue ) {
340339 // when a call returns successfully, that means we need to set
341- // the bits for that dest_lval to 1 (initialized).
342- let move_path_index = ctxt. move_data . rev_lookup . find ( dest_lval) ;
343- on_all_children_bits ( self . tcx , self . mir , & ctxt. move_data ,
344- move_path_index,
345- |mpi| { in_out. remove ( & mpi) ; } ) ;
340+ // the bits for that dest_lval to 0 (initialized).
341+ on_lookup_result_bits ( self . tcx , self . mir , & ctxt. move_data ,
342+ ctxt. move_data . rev_lookup . find ( dest_lval) ,
343+ |mpi| { in_out. remove ( & mpi) ; } ) ;
346344 }
347345}
348346
@@ -400,10 +398,9 @@ impl<'a, 'tcx> BitDenotation for DefinitelyInitializedLvals<'a, 'tcx> {
400398 dest_lval : & repr:: Lvalue ) {
401399 // when a call returns successfully, that means we need to set
402400 // the bits for that dest_lval to 1 (initialized).
403- let move_path_index = ctxt. move_data . rev_lookup . find ( dest_lval) ;
404- on_all_children_bits ( self . tcx , self . mir , & ctxt. move_data ,
405- move_path_index,
406- |mpi| { in_out. add ( & mpi) ; } ) ;
401+ on_lookup_result_bits ( self . tcx , self . mir , & ctxt. move_data ,
402+ ctxt. move_data . rev_lookup . find ( dest_lval) ,
403+ |mpi| { in_out. add ( & mpi) ; } ) ;
407404 }
408405}
409406
@@ -448,11 +445,10 @@ impl<'a, 'tcx> BitDenotation for MovingOutStatements<'a, 'tcx> {
448445 // assigning into this `lvalue` kills all
449446 // MoveOuts from it, and *also* all MoveOuts
450447 // for children and associated fragment sets.
451- let move_path_index = rev_lookup. find ( lvalue) ;
452- on_all_children_bits ( tcx,
448+ on_lookup_result_bits ( tcx,
453449 mir,
454450 move_data,
455- move_path_index ,
451+ rev_lookup . find ( lvalue ) ,
456452 |mpi| for moi in & path_map[ mpi] {
457453 assert ! ( moi. index( ) < bits_per_block) ;
458454 sets. kill_set . add ( & moi) ;
@@ -489,18 +485,17 @@ impl<'a, 'tcx> BitDenotation for MovingOutStatements<'a, 'tcx> {
489485 _dest_bb : repr:: BasicBlock ,
490486 dest_lval : & repr:: Lvalue ) {
491487 let move_data = & ctxt. move_data ;
492- let move_path_index = move_data. rev_lookup . find ( dest_lval) ;
493488 let bits_per_block = self . bits_per_block ( ctxt) ;
494489
495490 let path_map = & move_data. path_map ;
496- on_all_children_bits ( self . tcx ,
497- self . mir ,
498- move_data,
499- move_path_index ,
500- |mpi| for moi in & path_map[ mpi] {
501- assert ! ( moi. index( ) < bits_per_block) ;
502- in_out. remove ( & moi) ;
503- } ) ;
491+ on_lookup_result_bits ( self . tcx ,
492+ self . mir ,
493+ move_data,
494+ move_data . rev_lookup . find ( dest_lval ) ,
495+ |mpi| for moi in & path_map[ mpi] {
496+ assert ! ( moi. index( ) < bits_per_block) ;
497+ in_out. remove ( & moi) ;
498+ } ) ;
504499 }
505500}
506501
0 commit comments