Skip to content

Commit b4a3753

Browse files
committed
various centril nits
1 parent d2772e8 commit b4a3753

File tree

1 file changed

+11
-10
lines changed
  • src/librustc/infer/lexical_region_resolve

1 file changed

+11
-10
lines changed

src/librustc/infer/lexical_region_resolve/mod.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,10 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
218218
/// Enforce a constraint like
219219
///
220220
/// ```
221-
/// pick 'r from ['o...]
221+
/// 'r member of ['c...]
222222
/// ```
223223
///
224-
/// We look for all option regions from the list `'o...` that:
224+
/// We look for all choice regions from the list `'c...` that:
225225
///
226226
/// (a) are greater than the current value of `'r` (which is a lower bound)
227227
///
@@ -230,8 +230,8 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
230230
/// (b) are compatible with the upper bounds of `'r` that we can
231231
/// find by traversing the graph.
232232
///
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`.
235235
fn enforce_member_constraint(
236236
&self,
237237
graph: &RegionGraph<'tcx>,
@@ -241,7 +241,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
241241
debug!("enforce_member_constraint(member_constraint={:#?})", member_constraint);
242242

243243
// 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.
245245
let member_vid = match member_constraint.member_region {
246246
ty::ReVar(vid) => *vid,
247247
_ => return false,
@@ -254,7 +254,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
254254
VarValue::Value(r) => r,
255255
};
256256

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
258258
// `r0 <= b` must hold.
259259
let (member_upper_bounds, _) = self.collect_concrete_regions(
260260
graph,
@@ -263,7 +263,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
263263
None,
264264
);
265265

266-
// get an iterator over the *available choice* -- that is,
266+
// Get an iterator over the *available choice* -- that is,
267267
// each choice region `c` where `lb <= c` and `c <= ub` for all the
268268
// upper bounds `ub`.
269269
debug!("enforce_member_constraint: upper_bounds={:#?}", member_upper_bounds);
@@ -274,9 +274,9 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
274274
.all(|upper_bound| self.sub_concrete_regions(option, upper_bound.region))
275275
});
276276

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.
280280
let mut least_choice: ty::Region<'tcx> = match options.next() {
281281
Some(&r) => r,
282282
None => return false,
@@ -554,6 +554,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
554554
}
555555
}
556556

557+
// Check that all member constraints are satisfied.
557558
for member_constraint in &self.data.member_constraints {
558559
let member_region = var_data.normalize(self.tcx(), member_constraint.member_region);
559560
let choice_regions = member_constraint

0 commit comments

Comments
 (0)