22
22
/// Stores the data about each `R0 member of [R1..Rn]` constraint.
23
23
/// These are organized into a linked list, so each constraint
24
24
/// contains the index of the next constraint with the same `R0`.
25
- constraints : IndexVec < NllMemberConstraintIndex , NllMemberConstraint < ' tcx > > ,
25
+ constraints : IndexVec < NllMemberConstraintIndex , MemberConstraint < ' tcx > > ,
26
26
27
27
/// Stores the `R1..Rn` regions for *all* sets. For any given
28
28
/// constraint, we keep two indices so that we can pull out a
32
32
33
33
/// Represents a `R0 member of [R1..Rn]` constraint
34
34
#[ derive( Debug ) ]
35
- pub ( crate ) struct NllMemberConstraint < ' tcx > {
35
+ pub ( crate ) struct MemberConstraint < ' tcx > {
36
36
next_constraint : Option < NllMemberConstraintIndex > ,
37
37
38
38
/// The span where the hidden type was instantiated.
@@ -87,7 +87,7 @@ impl<'tcx> MemberConstraintSet<'tcx, ty::RegionVid> {
87
87
let start_index = self . choice_regions . len ( ) ;
88
88
self . choice_regions . extend ( choice_regions) ;
89
89
let end_index = self . choice_regions . len ( ) ;
90
- let constraint_index = self . constraints . push ( NllMemberConstraint {
90
+ let constraint_index = self . constraints . push ( MemberConstraint {
91
91
next_constraint,
92
92
member_region_vid,
93
93
definition_span,
@@ -98,14 +98,6 @@ impl<'tcx> MemberConstraintSet<'tcx, ty::RegionVid> {
98
98
} ) ;
99
99
self . first_constraints . insert ( member_region_vid, constraint_index) ;
100
100
}
101
-
102
- // TODO: removed in the next commit
103
- pub ( crate ) fn push_constraint (
104
- & mut self ,
105
- _: & rustc_middle:: infer:: MemberConstraint < ' tcx > ,
106
- _: impl FnMut ( ty:: Region < ' tcx > ) -> ty:: RegionVid ,
107
- ) {
108
- }
109
101
}
110
102
111
103
impl < ' tcx , R1 > MemberConstraintSet < ' tcx , R1 >
@@ -186,7 +178,7 @@ where
186
178
/// R0 member of [R1..Rn]
187
179
/// ```
188
180
pub ( crate ) fn choice_regions ( & self , pci : NllMemberConstraintIndex ) -> & [ ty:: RegionVid ] {
189
- let NllMemberConstraint { start_index, end_index, .. } = & self . constraints [ pci] ;
181
+ let MemberConstraint { start_index, end_index, .. } = & self . constraints [ pci] ;
190
182
& self . choice_regions [ * start_index..* end_index]
191
183
}
192
184
}
@@ -195,9 +187,9 @@ impl<'tcx, R> Index<NllMemberConstraintIndex> for MemberConstraintSet<'tcx, R>
195
187
where
196
188
R : Copy + Eq ,
197
189
{
198
- type Output = NllMemberConstraint < ' tcx > ;
190
+ type Output = MemberConstraint < ' tcx > ;
199
191
200
- fn index ( & self , i : NllMemberConstraintIndex ) -> & NllMemberConstraint < ' tcx > {
192
+ fn index ( & self , i : NllMemberConstraintIndex ) -> & MemberConstraint < ' tcx > {
201
193
& self . constraints [ i]
202
194
}
203
195
}
@@ -219,7 +211,7 @@ where
219
211
/// target_list: A -> B -> C -> D -> E -> F -> (None)
220
212
/// ```
221
213
fn append_list (
222
- constraints : & mut IndexSlice < NllMemberConstraintIndex , NllMemberConstraint < ' _ > > ,
214
+ constraints : & mut IndexSlice < NllMemberConstraintIndex , MemberConstraint < ' _ > > ,
223
215
target_list : NllMemberConstraintIndex ,
224
216
source_list : NllMemberConstraintIndex ,
225
217
) {
0 commit comments