@@ -11,43 +11,33 @@ use rustc_middle::ty::TyCtxt;
1111use rustc_mir_dataflow:: impls:: { EverInitializedPlaces , MaybeUninitializedPlaces } ;
1212use rustc_mir_dataflow:: ResultsVisitable ;
1313use rustc_mir_dataflow:: { self , fmt:: DebugWithContext , GenKill } ;
14- use rustc_mir_dataflow:: { Analysis , Direction , Results } ;
14+ use rustc_mir_dataflow:: { Analysis , AnalysisDomain , Results } ;
1515use std:: fmt;
1616
1717use crate :: { places_conflict, BorrowSet , PlaceConflictBias , PlaceExt , RegionInferenceContext } ;
1818
19- /// A tuple with named fields that can hold either the results or the transient state of the
20- /// dataflow analyses used by the borrow checker.
21- #[ derive( Debug ) ]
22- pub struct BorrowckAnalyses < B , U , E > {
23- pub borrows : B ,
24- pub uninits : U ,
25- pub ever_inits : E ,
26- }
27-
2819/// The results of the dataflow analyses used by the borrow checker.
29- pub type BorrowckResults < ' mir , ' tcx > = BorrowckAnalyses <
30- Results < ' tcx , Borrows < ' mir , ' tcx > > ,
31- Results < ' tcx , MaybeUninitializedPlaces < ' mir , ' tcx > > ,
32- Results < ' tcx , EverInitializedPlaces < ' mir , ' tcx > > ,
33- > ;
20+ pub struct BorrowckResults < ' mir , ' tcx > {
21+ pub ( crate ) borrows : Results < ' tcx , Borrows < ' mir , ' tcx > > ,
22+ pub ( crate ) uninits : Results < ' tcx , MaybeUninitializedPlaces < ' mir , ' tcx > > ,
23+ pub ( crate ) ever_inits : Results < ' tcx , EverInitializedPlaces < ' mir , ' tcx > > ,
24+ }
3425
3526/// The transient state of the dataflow analyses used by the borrow checker.
36- pub type BorrowckFlowState < ' mir , ' tcx > =
37- <BorrowckResults < ' mir , ' tcx > as ResultsVisitable < ' tcx > >:: FlowState ;
38-
39- impl < ' tcx , B , U , E , D : Direction > ResultsVisitable < ' tcx >
40- for BorrowckAnalyses < Results < ' tcx , B > , Results < ' tcx , U > , Results < ' tcx , E > >
41- where
42- B : Analysis < ' tcx , Direction = D > ,
43- U : Analysis < ' tcx , Direction = D > ,
44- E : Analysis < ' tcx , Direction = D > ,
45- {
46- type Direction = D ;
47- type FlowState = BorrowckAnalyses < B :: Domain , U :: Domain , E :: Domain > ;
27+ #[ derive( Debug ) ]
28+ pub struct BorrowckFlowState < ' mir , ' tcx > {
29+ pub ( crate ) borrows : <Borrows < ' mir , ' tcx > as AnalysisDomain < ' tcx > >:: Domain ,
30+ pub ( crate ) uninits : <MaybeUninitializedPlaces < ' mir , ' tcx > as AnalysisDomain < ' tcx > >:: Domain ,
31+ pub ( crate ) ever_inits : <EverInitializedPlaces < ' mir , ' tcx > as AnalysisDomain < ' tcx > >:: Domain ,
32+ }
33+
34+ impl < ' mir , ' tcx > ResultsVisitable < ' tcx > for BorrowckResults < ' mir , ' tcx > {
35+ // All three analyses are forward, but we have to use just one here.
36+ type Direction = <Borrows < ' mir , ' tcx > as AnalysisDomain < ' tcx > >:: Direction ;
37+ type FlowState = BorrowckFlowState < ' mir , ' tcx > ;
4838
4939 fn new_flow_state ( & self , body : & mir:: Body < ' tcx > ) -> Self :: FlowState {
50- BorrowckAnalyses {
40+ BorrowckFlowState {
5141 borrows : self . borrows . analysis . bottom_value ( body) ,
5242 uninits : self . uninits . analysis . bottom_value ( body) ,
5343 ever_inits : self . ever_inits . analysis . bottom_value ( body) ,
0 commit comments