@@ -47,7 +47,7 @@ use rustc_mir_dataflow::impls::{
47
47
use rustc_mir_dataflow:: move_paths:: {
48
48
InitIndex , InitLocation , LookupResult , MoveData , MovePathIndex ,
49
49
} ;
50
- use rustc_mir_dataflow:: { Analysis , EntryStates , Results , ResultsVisitor , visit_results} ;
50
+ use rustc_mir_dataflow:: { Analysis , Results , ResultsVisitor , visit_results} ;
51
51
use rustc_session:: lint:: builtin:: { TAIL_EXPR_DROP_ORDER , UNUSED_MUT } ;
52
52
use rustc_span:: { ErrorGuaranteed , Span , Symbol } ;
53
53
use smallvec:: SmallVec ;
@@ -469,11 +469,13 @@ fn do_mir_borrowck<'tcx>(
469
469
// Compute and report region errors, if any.
470
470
mbcx. report_region_errors ( nll_errors) ;
471
471
472
- let mut flow_results = get_flow_results ( tcx, body, & move_data, & borrow_set, & regioncx) ;
472
+ let ( mut flow_analysis, flow_entry_states) =
473
+ get_flow_results ( tcx, body, & move_data, & borrow_set, & regioncx) ;
473
474
visit_results (
474
475
body,
475
476
traversal:: reverse_postorder ( body) . map ( |( bb, _) | bb) ,
476
- & mut flow_results,
477
+ & mut flow_analysis,
478
+ & flow_entry_states,
477
479
& mut mbcx,
478
480
) ;
479
481
@@ -533,7 +535,7 @@ fn get_flow_results<'a, 'tcx>(
533
535
move_data : & ' a MoveData < ' tcx > ,
534
536
borrow_set : & ' a BorrowSet < ' tcx > ,
535
537
regioncx : & RegionInferenceContext < ' tcx > ,
536
- ) -> Results < ' tcx , Borrowck < ' a , ' tcx > > {
538
+ ) -> ( Borrowck < ' a , ' tcx > , Results < BorrowckDomain > ) {
537
539
// We compute these three analyses individually, but them combine them into
538
540
// a single results so that `mbcx` can visit them all together.
539
541
let borrows = Borrows :: new ( tcx, body, regioncx, borrow_set) . iterate_to_fixpoint (
@@ -558,14 +560,14 @@ fn get_flow_results<'a, 'tcx>(
558
560
ever_inits : ever_inits. analysis ,
559
561
} ;
560
562
561
- assert_eq ! ( borrows. entry_states . len( ) , uninits. entry_states . len( ) ) ;
562
- assert_eq ! ( borrows. entry_states . len( ) , ever_inits. entry_states . len( ) ) ;
563
- let entry_states : EntryStates < ' _ , Borrowck < ' _ , ' _ > > =
564
- itertools:: izip!( borrows. entry_states , uninits. entry_states , ever_inits. entry_states )
563
+ assert_eq ! ( borrows. results . len( ) , uninits. results . len( ) ) ;
564
+ assert_eq ! ( borrows. results . len( ) , ever_inits. results . len( ) ) ;
565
+ let results : Results < _ > =
566
+ itertools:: izip!( borrows. results , uninits. results , ever_inits. results )
565
567
. map ( |( borrows, uninits, ever_inits) | BorrowckDomain { borrows, uninits, ever_inits } )
566
568
. collect ( ) ;
567
569
568
- Results { analysis, entry_states }
570
+ ( analysis, results )
569
571
}
570
572
571
573
pub ( crate ) struct BorrowckInferCtxt < ' tcx > {
@@ -713,7 +715,7 @@ struct MirBorrowckCtxt<'a, 'infcx, 'tcx> {
713
715
impl < ' a , ' tcx > ResultsVisitor < ' tcx , Borrowck < ' a , ' tcx > > for MirBorrowckCtxt < ' a , ' _ , ' tcx > {
714
716
fn visit_after_early_statement_effect (
715
717
& mut self ,
716
- _results : & mut Results < ' tcx , Borrowck < ' a , ' tcx > > ,
718
+ _analysis : & mut Borrowck < ' a , ' tcx > ,
717
719
state : & BorrowckDomain ,
718
720
stmt : & Statement < ' tcx > ,
719
721
location : Location ,
@@ -789,7 +791,7 @@ impl<'a, 'tcx> ResultsVisitor<'tcx, Borrowck<'a, 'tcx>> for MirBorrowckCtxt<'a,
789
791
790
792
fn visit_after_early_terminator_effect (
791
793
& mut self ,
792
- _results : & mut Results < ' tcx , Borrowck < ' a , ' tcx > > ,
794
+ _analysis : & mut Borrowck < ' a , ' tcx > ,
793
795
state : & BorrowckDomain ,
794
796
term : & Terminator < ' tcx > ,
795
797
loc : Location ,
@@ -909,7 +911,7 @@ impl<'a, 'tcx> ResultsVisitor<'tcx, Borrowck<'a, 'tcx>> for MirBorrowckCtxt<'a,
909
911
910
912
fn visit_after_primary_terminator_effect (
911
913
& mut self ,
912
- _results : & mut Results < ' tcx , Borrowck < ' a , ' tcx > > ,
914
+ _analysis : & mut Borrowck < ' a , ' tcx > ,
913
915
state : & BorrowckDomain ,
914
916
term : & Terminator < ' tcx > ,
915
917
loc : Location ,
0 commit comments