@@ -610,7 +610,13 @@ fn do_mir_borrowck<'tcx>(
610
610
// }
611
611
612
612
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
614
620
let ( mut flow_analysis, flow_entry_states) =
615
621
get_flow_results ( tcx, body, & move_data, & borrow_set, & regioncx) ;
616
622
visit_results (
@@ -620,13 +626,6 @@ fn do_mir_borrowck<'tcx>(
620
626
& flow_entry_states,
621
627
& mut mbcx,
622
628
) ;
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) ;
630
629
}
631
630
632
631
// 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>(
2552
2551
result
2553
2552
}
2554
2553
2555
- #[ cfg( test) ]
2556
2554
fn compute_cyclic_dataflow < ' mir , ' tcx > (
2557
2555
body : & Body < ' tcx > ,
2558
2556
borrows : Borrows < ' mir , ' tcx > ,
0 commit comments