9
9
// except according to those terms.
10
10
11
11
use borrow_check:: nll:: region_infer:: values:: { PointIndex , RegionValueElements } ;
12
- use borrow_check:: nll:: type_check:: liveness:: liveness_map:: { LocalWithRegion , NllLivenessMap } ;
12
+ use borrow_check:: nll:: type_check:: liveness:: liveness_map:: { LiveVar , NllLivenessMap } ;
13
13
use rustc:: mir:: visit:: { PlaceContext , Visitor } ;
14
14
use rustc:: mir:: { Local , Location , Mir } ;
15
15
use rustc_data_structures:: indexed_vec:: { Idx , IndexVec } ;
@@ -27,18 +27,18 @@ crate struct LocalUseMap<'me> {
27
27
/// defined in `x = y` but not `y`; that first def is the head of
28
28
/// a linked list that lets you enumerate all places the variable
29
29
/// is assigned.
30
- first_def_at : IndexVec < LocalWithRegion , Option < AppearanceIndex > > ,
30
+ first_def_at : IndexVec < LiveVar , Option < AppearanceIndex > > ,
31
31
32
32
/// Head of a linked list of **uses** of each variable -- use in
33
33
/// this context means that the existing value of the variable is
34
34
/// read or modified. e.g., `y` is used in `x = y` but not `x`.
35
35
/// Note that `DROP(x)` terminators are excluded from this list.
36
- first_use_at : IndexVec < LocalWithRegion , Option < AppearanceIndex > > ,
36
+ first_use_at : IndexVec < LiveVar , Option < AppearanceIndex > > ,
37
37
38
38
/// Head of a linked list of **drops** of each variable -- these
39
39
/// are a special category of uses corresponding to the drop that
40
40
/// we add for each local variable.
41
- first_drop_at : IndexVec < LocalWithRegion , Option < AppearanceIndex > > ,
41
+ first_drop_at : IndexVec < LiveVar , Option < AppearanceIndex > > ,
42
42
43
43
appearances : IndexVec < AppearanceIndex , Appearance > ,
44
44
}
@@ -81,17 +81,17 @@ impl LocalUseMap<'me> {
81
81
local_use_map
82
82
}
83
83
84
- crate fn defs ( & self , local : LocalWithRegion ) -> impl Iterator < Item = PointIndex > + ' _ {
84
+ crate fn defs ( & self , local : LiveVar ) -> impl Iterator < Item = PointIndex > + ' _ {
85
85
vll:: iter ( self . first_def_at [ local] , & self . appearances )
86
86
. map ( move |aa| self . appearances [ aa] . point_index )
87
87
}
88
88
89
- crate fn uses ( & self , local : LocalWithRegion ) -> impl Iterator < Item = PointIndex > + ' _ {
89
+ crate fn uses ( & self , local : LiveVar ) -> impl Iterator < Item = PointIndex > + ' _ {
90
90
vll:: iter ( self . first_use_at [ local] , & self . appearances )
91
91
. map ( move |aa| self . appearances [ aa] . point_index )
92
92
}
93
93
94
- crate fn drops ( & self , local : LocalWithRegion ) -> impl Iterator < Item = PointIndex > + ' _ {
94
+ crate fn drops ( & self , local : LiveVar ) -> impl Iterator < Item = PointIndex > + ' _ {
95
95
vll:: iter ( self . first_drop_at [ local] , & self . appearances )
96
96
. map ( move |aa| self . appearances [ aa] . point_index )
97
97
}
@@ -103,7 +103,7 @@ struct LocalUseMapBuild<'me, 'map> {
103
103
}
104
104
105
105
impl LocalUseMapBuild < ' _ , ' _ > {
106
- fn insert_def ( & mut self , local : LocalWithRegion , location : Location ) {
106
+ fn insert_def ( & mut self , local : LiveVar , location : Location ) {
107
107
Self :: insert (
108
108
self . elements ,
109
109
& mut self . local_use_map . first_def_at [ local] ,
@@ -112,7 +112,7 @@ impl LocalUseMapBuild<'_, '_> {
112
112
) ;
113
113
}
114
114
115
- fn insert_use ( & mut self , local : LocalWithRegion , location : Location ) {
115
+ fn insert_use ( & mut self , local : LiveVar , location : Location ) {
116
116
Self :: insert (
117
117
self . elements ,
118
118
& mut self . local_use_map . first_use_at [ local] ,
@@ -121,7 +121,7 @@ impl LocalUseMapBuild<'_, '_> {
121
121
) ;
122
122
}
123
123
124
- fn insert_drop ( & mut self , local : LocalWithRegion , location : Location ) {
124
+ fn insert_drop ( & mut self , local : LiveVar , location : Location ) {
125
125
Self :: insert (
126
126
self . elements ,
127
127
& mut self . local_use_map . first_drop_at [ local] ,
0 commit comments