@@ -218,10 +218,10 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
218
218
/// Enforce a constraint like
219
219
///
220
220
/// ```
221
- /// pick 'r from ['o ...]
221
+ /// 'r member of ['c ...]
222
222
/// ```
223
223
///
224
- /// We look for all option regions from the list `'o ...` that:
224
+ /// We look for all choice regions from the list `'c ...` that:
225
225
///
226
226
/// (a) are greater than the current value of `'r` (which is a lower bound)
227
227
///
@@ -230,8 +230,8 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
230
230
/// (b) are compatible with the upper bounds of `'r` that we can
231
231
/// find by traversing the graph.
232
232
///
233
- /// From that list, we look for a *minimal* option `'o_min `. If we
234
- /// find one, then we can enforce that `'r: 'o_min `.
233
+ /// From that list, we look for a *minimal* option `'c_min `. If we
234
+ /// find one, then we can enforce that `'r: 'c_min `.
235
235
fn enforce_member_constraint (
236
236
& self ,
237
237
graph : & RegionGraph < ' tcx > ,
@@ -241,7 +241,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
241
241
debug ! ( "enforce_member_constraint(member_constraint={:#?})" , member_constraint) ;
242
242
243
243
// The constraint is some inference variable (`vid`) which
244
- // must be equal to one of the options
244
+ // must be equal to one of the options.
245
245
let member_vid = match member_constraint. member_region {
246
246
ty:: ReVar ( vid) => * vid,
247
247
_ => return false ,
@@ -254,7 +254,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
254
254
VarValue :: Value ( r) => r,
255
255
} ;
256
256
257
- // find all the "upper bounds" -- that is, each region `b` such that
257
+ // Find all the "upper bounds" -- that is, each region `b` such that
258
258
// `r0 <= b` must hold.
259
259
let ( member_upper_bounds, _) = self . collect_concrete_regions (
260
260
graph,
@@ -263,7 +263,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
263
263
None ,
264
264
) ;
265
265
266
- // get an iterator over the *available choice* -- that is,
266
+ // Get an iterator over the *available choice* -- that is,
267
267
// each choice region `c` where `lb <= c` and `c <= ub` for all the
268
268
// upper bounds `ub`.
269
269
debug ! ( "enforce_member_constraint: upper_bounds={:#?}" , member_upper_bounds) ;
@@ -274,9 +274,9 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
274
274
. all ( |upper_bound| self . sub_concrete_regions ( option, upper_bound. region ) )
275
275
} ) ;
276
276
277
- // if there >1 option, we only make a choice if there is a
278
- // single *least* choice -- i.e., some available region that
279
- // is `<=` all the others.
277
+ // If there is more than one option, we only make a choice if
278
+ // there is a single *least* choice -- i.e., some available
279
+ // region that is `<=` all the others.
280
280
let mut least_choice: ty:: Region < ' tcx > = match options. next ( ) {
281
281
Some ( & r) => r,
282
282
None => return false ,
@@ -554,6 +554,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
554
554
}
555
555
}
556
556
557
+ // Check that all member constraints are satisfied.
557
558
for member_constraint in & self . data . member_constraints {
558
559
let member_region = var_data. normalize ( self . tcx ( ) , member_constraint. member_region ) ;
559
560
let choice_regions = member_constraint
0 commit comments