@@ -610,7 +610,13 @@ fn do_mir_borrowck<'tcx>(
610610 // }
611611
612612 if body. basic_blocks . thir_had_loops != Some ( false ) {
613- // Cyclic
613+ // Cyclic: "single-pass"
614+ let borrows = Borrows :: new ( tcx, body, & regioncx, & borrow_set) ;
615+ let uninits = MaybeUninitializedPlaces :: new ( tcx, body, & move_data) ;
616+ let ever_inits = EverInitializedPlaces :: new ( body, & move_data) ;
617+ compute_cyclic_dataflow ( body, borrows, uninits, ever_inits, & mut mbcx) ;
618+ } else {
619+ // Acyclic: default
614620 let ( mut flow_analysis, flow_entry_states) =
615621 get_flow_results ( tcx, body, & move_data, & borrow_set, & regioncx) ;
616622 visit_results (
@@ -620,13 +626,6 @@ fn do_mir_borrowck<'tcx>(
620626 & flow_entry_states,
621627 & mut mbcx,
622628 ) ;
623- } else {
624- // Acyclic
625- let borrows = Borrows :: new ( tcx, body, & regioncx, & borrow_set) ;
626- let uninits = MaybeUninitializedPlaces :: new ( tcx, body, & move_data) ;
627- let ever_inits = EverInitializedPlaces :: new ( body, & move_data) ;
628- let mut analysis = Borrowck { borrows, uninits, ever_inits } ;
629- compute_rpo_dataflow ( body, & mut analysis, & mut mbcx) ;
630629 }
631630
632631 // if body.basic_blocks.thir_had_loops.unwrap_or_else(|| body.basic_blocks.is_cfg_cyclic()) {
@@ -2552,7 +2551,6 @@ fn do_mir_borrowck<'tcx>(
25522551 result
25532552}
25542553
2555- #[ cfg( test) ]
25562554fn compute_cyclic_dataflow < ' mir , ' tcx > (
25572555 body : & Body < ' tcx > ,
25582556 borrows : Borrows < ' mir , ' tcx > ,
0 commit comments