@@ -9,7 +9,7 @@ use rustc_middle::mir::{
9
9
use rustc_middle:: ty:: { RegionVid , TyCtxt } ;
10
10
use rustc_mir_dataflow:: fmt:: DebugWithContext ;
11
11
use rustc_mir_dataflow:: impls:: { EverInitializedPlaces , MaybeUninitializedPlaces } ;
12
- use rustc_mir_dataflow:: { Analysis , AnalysisDomain , GenKill , Results , ResultsVisitable } ;
12
+ use rustc_mir_dataflow:: { Analysis , AnalysisDomain , Forward , GenKill , Results , ResultsVisitable } ;
13
13
use tracing:: debug;
14
14
15
15
use crate :: { places_conflict, BorrowSet , PlaceConflictBias , PlaceExt , RegionInferenceContext } ;
@@ -23,34 +23,33 @@ pub(crate) struct BorrowckResults<'a, 'tcx> {
23
23
24
24
/// The transient state of the dataflow analyses used by the borrow checker.
25
25
#[ derive( Debug ) ]
26
- pub ( crate ) struct BorrowckFlowState < ' a , ' tcx > {
26
+ pub ( crate ) struct BorrowckDomain < ' a , ' tcx > {
27
27
pub ( crate ) borrows : <Borrows < ' a , ' tcx > as AnalysisDomain < ' tcx > >:: Domain ,
28
28
pub ( crate ) uninits : <MaybeUninitializedPlaces < ' a , ' tcx > as AnalysisDomain < ' tcx > >:: Domain ,
29
29
pub ( crate ) ever_inits : <EverInitializedPlaces < ' a , ' tcx > as AnalysisDomain < ' tcx > >:: Domain ,
30
30
}
31
31
32
32
impl < ' a , ' tcx > ResultsVisitable < ' tcx > for BorrowckResults < ' a , ' tcx > {
33
- // All three analyses are forward, but we have to use just one here.
34
- type Direction = <Borrows < ' a , ' tcx > as AnalysisDomain < ' tcx > >:: Direction ;
35
- type FlowState = BorrowckFlowState < ' a , ' tcx > ;
33
+ type Direction = Forward ;
34
+ type Domain = BorrowckDomain < ' a , ' tcx > ;
36
35
37
- fn new_flow_state ( & self , body : & mir:: Body < ' tcx > ) -> Self :: FlowState {
38
- BorrowckFlowState {
36
+ fn bottom_value ( & self , body : & mir:: Body < ' tcx > ) -> Self :: Domain {
37
+ BorrowckDomain {
39
38
borrows : self . borrows . analysis . bottom_value ( body) ,
40
39
uninits : self . uninits . analysis . bottom_value ( body) ,
41
40
ever_inits : self . ever_inits . analysis . bottom_value ( body) ,
42
41
}
43
42
}
44
43
45
- fn reset_to_block_entry ( & self , state : & mut Self :: FlowState , block : BasicBlock ) {
44
+ fn reset_to_block_entry ( & self , state : & mut Self :: Domain , block : BasicBlock ) {
46
45
state. borrows . clone_from ( self . borrows . entry_set_for_block ( block) ) ;
47
46
state. uninits . clone_from ( self . uninits . entry_set_for_block ( block) ) ;
48
47
state. ever_inits . clone_from ( self . ever_inits . entry_set_for_block ( block) ) ;
49
48
}
50
49
51
50
fn reconstruct_before_statement_effect (
52
51
& mut self ,
53
- state : & mut Self :: FlowState ,
52
+ state : & mut Self :: Domain ,
54
53
stmt : & mir:: Statement < ' tcx > ,
55
54
loc : Location ,
56
55
) {
@@ -61,7 +60,7 @@ impl<'a, 'tcx> ResultsVisitable<'tcx> for BorrowckResults<'a, 'tcx> {
61
60
62
61
fn reconstruct_statement_effect (
63
62
& mut self ,
64
- state : & mut Self :: FlowState ,
63
+ state : & mut Self :: Domain ,
65
64
stmt : & mir:: Statement < ' tcx > ,
66
65
loc : Location ,
67
66
) {
@@ -72,7 +71,7 @@ impl<'a, 'tcx> ResultsVisitable<'tcx> for BorrowckResults<'a, 'tcx> {
72
71
73
72
fn reconstruct_before_terminator_effect (
74
73
& mut self ,
75
- state : & mut Self :: FlowState ,
74
+ state : & mut Self :: Domain ,
76
75
term : & mir:: Terminator < ' tcx > ,
77
76
loc : Location ,
78
77
) {
@@ -83,7 +82,7 @@ impl<'a, 'tcx> ResultsVisitable<'tcx> for BorrowckResults<'a, 'tcx> {
83
82
84
83
fn reconstruct_terminator_effect (
85
84
& mut self ,
86
- state : & mut Self :: FlowState ,
85
+ state : & mut Self :: Domain ,
87
86
term : & mir:: Terminator < ' tcx > ,
88
87
loc : Location ,
89
88
) {
0 commit comments