@@ -97,11 +97,11 @@ impl<D: ConstraintGraphDirection> ConstraintGraph<D> {
97
97
/// Given the constraint set from which this graph was built
98
98
/// creates a region graph so that you can iterate over *regions*
99
99
/// and not constraints.
100
- pub ( crate ) fn region_graph < ' rg , ' tcx > (
101
- & ' rg self ,
102
- set : & ' rg OutlivesConstraintSet < ' tcx > ,
100
+ pub ( crate ) fn region_graph < ' a , ' tcx > (
101
+ & ' a self ,
102
+ set : & ' a OutlivesConstraintSet < ' tcx > ,
103
103
static_region : RegionVid ,
104
- ) -> RegionGraph < ' rg , ' tcx , D > {
104
+ ) -> RegionGraph < ' a , ' tcx , D > {
105
105
RegionGraph :: new ( set, self , static_region)
106
106
}
107
107
@@ -130,15 +130,15 @@ impl<D: ConstraintGraphDirection> ConstraintGraph<D> {
130
130
}
131
131
}
132
132
133
- pub ( crate ) struct Edges < ' s , ' tcx , D : ConstraintGraphDirection > {
134
- graph : & ' s ConstraintGraph < D > ,
135
- constraints : & ' s OutlivesConstraintSet < ' tcx > ,
133
+ pub ( crate ) struct Edges < ' a , ' tcx , D : ConstraintGraphDirection > {
134
+ graph : & ' a ConstraintGraph < D > ,
135
+ constraints : & ' a OutlivesConstraintSet < ' tcx > ,
136
136
pointer : Option < OutlivesConstraintIndex > ,
137
137
next_static_idx : Option < usize > ,
138
138
static_region : RegionVid ,
139
139
}
140
140
141
- impl < ' s , ' tcx , D : ConstraintGraphDirection > Iterator for Edges < ' s , ' tcx , D > {
141
+ impl < ' a , ' tcx , D : ConstraintGraphDirection > Iterator for Edges < ' a , ' tcx , D > {
142
142
type Item = OutlivesConstraint < ' tcx > ;
143
143
144
144
fn next ( & mut self ) -> Option < Self :: Item > {
@@ -171,55 +171,55 @@ impl<'s, 'tcx, D: ConstraintGraphDirection> Iterator for Edges<'s, 'tcx, D> {
171
171
/// This struct brings together a constraint set and a (normal, not
172
172
/// reverse) constraint graph. It implements the graph traits and is
173
173
/// usd for doing the SCC computation.
174
- pub ( crate ) struct RegionGraph < ' s , ' tcx , D : ConstraintGraphDirection > {
175
- set : & ' s OutlivesConstraintSet < ' tcx > ,
176
- constraint_graph : & ' s ConstraintGraph < D > ,
174
+ pub ( crate ) struct RegionGraph < ' a , ' tcx , D : ConstraintGraphDirection > {
175
+ set : & ' a OutlivesConstraintSet < ' tcx > ,
176
+ constraint_graph : & ' a ConstraintGraph < D > ,
177
177
static_region : RegionVid ,
178
178
}
179
179
180
- impl < ' s , ' tcx , D : ConstraintGraphDirection > RegionGraph < ' s , ' tcx , D > {
180
+ impl < ' a , ' tcx , D : ConstraintGraphDirection > RegionGraph < ' a , ' tcx , D > {
181
181
/// Creates a "dependency graph" where each region constraint `R1:
182
182
/// R2` is treated as an edge `R1 -> R2`. We use this graph to
183
183
/// construct SCCs for region inference but also for error
184
184
/// reporting.
185
185
pub ( crate ) fn new (
186
- set : & ' s OutlivesConstraintSet < ' tcx > ,
187
- constraint_graph : & ' s ConstraintGraph < D > ,
186
+ set : & ' a OutlivesConstraintSet < ' tcx > ,
187
+ constraint_graph : & ' a ConstraintGraph < D > ,
188
188
static_region : RegionVid ,
189
189
) -> Self {
190
190
Self { set, constraint_graph, static_region }
191
191
}
192
192
193
193
/// Given a region `R`, iterate over all regions `R1` such that
194
194
/// there exists a constraint `R: R1`.
195
- pub ( crate ) fn outgoing_regions ( & self , region_sup : RegionVid ) -> Successors < ' s , ' tcx , D > {
195
+ pub ( crate ) fn outgoing_regions ( & self , region_sup : RegionVid ) -> Successors < ' a , ' tcx , D > {
196
196
Successors {
197
197
edges : self . constraint_graph . outgoing_edges ( region_sup, self . set , self . static_region ) ,
198
198
}
199
199
}
200
200
}
201
201
202
- pub ( crate ) struct Successors < ' s , ' tcx , D : ConstraintGraphDirection > {
203
- edges : Edges < ' s , ' tcx , D > ,
202
+ pub ( crate ) struct Successors < ' a , ' tcx , D : ConstraintGraphDirection > {
203
+ edges : Edges < ' a , ' tcx , D > ,
204
204
}
205
205
206
- impl < ' s , ' tcx , D : ConstraintGraphDirection > Iterator for Successors < ' s , ' tcx , D > {
206
+ impl < ' a , ' tcx , D : ConstraintGraphDirection > Iterator for Successors < ' a , ' tcx , D > {
207
207
type Item = RegionVid ;
208
208
209
209
fn next ( & mut self ) -> Option < Self :: Item > {
210
210
self . edges . next ( ) . map ( |c| D :: end_region ( & c) )
211
211
}
212
212
}
213
213
214
- impl < ' s , ' tcx , D : ConstraintGraphDirection > graph:: DirectedGraph for RegionGraph < ' s , ' tcx , D > {
214
+ impl < ' a , ' tcx , D : ConstraintGraphDirection > graph:: DirectedGraph for RegionGraph < ' a , ' tcx , D > {
215
215
type Node = RegionVid ;
216
216
217
217
fn num_nodes ( & self ) -> usize {
218
218
self . constraint_graph . first_constraints . len ( )
219
219
}
220
220
}
221
221
222
- impl < ' s , ' tcx , D : ConstraintGraphDirection > graph:: Successors for RegionGraph < ' s , ' tcx , D > {
222
+ impl < ' a , ' tcx , D : ConstraintGraphDirection > graph:: Successors for RegionGraph < ' a , ' tcx , D > {
223
223
fn successors ( & self , node : Self :: Node ) -> impl Iterator < Item = Self :: Node > {
224
224
self . outgoing_regions ( node)
225
225
}
0 commit comments