@@ -194,6 +194,14 @@ impl<'cx, 'bccx, 'gcx, 'tcx> TypeRelating<'cx, 'bccx, 'gcx, 'tcx> {
194
194
scope
195
195
}
196
196
197
+ /// When we encounter binders during the type traversal, we record
198
+ /// the value to substitute for each of the things contained in
199
+ /// that binder. (This will be either a universal placeholder or
200
+ /// an existential inference variable.) Given the debruijn index
201
+ /// `debruijn` (and name `br`) of some binder we have now
202
+ /// encountered, this routine finds the value that we instantiated
203
+ /// the region with; to do so, it indexes backwards into the list
204
+ /// of ambient scopes `scopes`.
197
205
fn lookup_bound_region (
198
206
& self ,
199
207
debruijn : ty:: DebruijnIndex ,
@@ -211,6 +219,9 @@ impl<'cx, 'bccx, 'gcx, 'tcx> TypeRelating<'cx, 'bccx, 'gcx, 'tcx> {
211
219
scope. map [ br]
212
220
}
213
221
222
+ /// If `r` is a bound region, find the scope in which it is bound
223
+ /// (from `scopes`) and return the value that we instantiated it
224
+ /// with. Otherwise just return `r`.
214
225
fn replace_bound_region (
215
226
& self ,
216
227
universal_regions : & UniversalRegions < ' tcx > ,
@@ -226,6 +237,8 @@ impl<'cx, 'bccx, 'gcx, 'tcx> TypeRelating<'cx, 'bccx, 'gcx, 'tcx> {
226
237
}
227
238
}
228
239
240
+ /// Push a new outlives requirement into our output set of
241
+ /// constraints.
229
242
fn push_outlives ( & mut self , sup : RegionVid , sub : RegionVid ) {
230
243
debug ! ( "push_outlives({:?}: {:?})" , sup, sub) ;
231
244
@@ -243,6 +256,9 @@ impl<'cx, 'bccx, 'gcx, 'tcx> TypeRelating<'cx, 'bccx, 'gcx, 'tcx> {
243
256
}
244
257
}
245
258
259
+ /// When we encounter a canonical variable `var` in the output,
260
+ /// equate it with `kind`. If the variable has been previously
261
+ /// equated, then equate it again.
246
262
fn equate_var (
247
263
& mut self ,
248
264
var : CanonicalVar ,
0 commit comments