Skip to content

Commit

Permalink
more nits + typos
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Jul 2, 2019
1 parent 9217909 commit 076b0d0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/librustc_mir/borrow_check/nll/region_infer/mod.rs
Expand Up @@ -598,7 +598,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
}
}

// Now take member constraints into account.
// Now take member constraints into account.
let member_constraints = self.member_constraints.clone();
for m_c_i in member_constraints.indices(scc_a) {
self.apply_member_constraint(
Expand Down Expand Up @@ -1560,15 +1560,15 @@ impl<'tcx> RegionInferenceContext<'tcx> {
let choice_regions = member_constraints.choice_regions(m_c_i);
debug!("check_member_constraint: choice_regions={:?}", choice_regions);

// did the pick-region wind up equal to any of the option regions?
// Did the member region wind up equal to any of the option regions?
if let Some(o) = choice_regions.iter().find(|&&o_r| {
self.eval_equal(o_r, m_c.member_region_vid)
}) {
debug!("check_member_constraint: evaluated as equal to {:?}", o);
continue;
}

// if not, report an error
// If not, report an error.
let region_scope_tree = &infcx.tcx.region_scope_tree(mir_def_id);
let member_region = infcx.tcx.mk_region(ty::ReVar(member_region_vid));
opaque_types::unexpected_hidden_region_diagnostic(
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_mir/borrow_check/nll/type_check/mod.rs
Expand Up @@ -2519,9 +2519,9 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
let closure_constraints = QueryRegionConstraints {
outlives: closure_region_requirements.apply_requirements(tcx, def_id, substs),

// Presently, closures never propagate pick
// Presently, closures never propagate member
// constraints to their parents -- they are enforced
// locally. This is largely a non-issue as pick
// locally. This is largely a non-issue as member
// constraints only come from `-> impl Trait` and
// friends which don't appear (thus far...) in
// closures.
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/feature_gate.rs
Expand Up @@ -570,7 +570,7 @@ declare_features! (
// Allows explicit discriminants on non-unit enum variants.
(active, arbitrary_enum_discriminant, "1.37.0", Some(60553), None),

// Allows impl trait with multiple unrelated lifetimes
// Allows `impl Trait` with multiple unrelated lifetimes.
(active, member_constraints, "1.37.0", Some(61977), None),

// -------------------------------------------------------------------------
Expand Down
Expand Up @@ -10,7 +10,7 @@ trait Trait<'a, 'b> { }
impl<T> Trait<'_, '_> for T { }

// Here we wind up selecting `'a` and `'b` in the hidden type because
// those are the types that appear inth e original values.
// those are the types that appear in the original values.

existential type Foo<'a, 'b>: Trait<'a, 'b>;

Expand Down
Expand Up @@ -9,7 +9,7 @@ trait Trait<'a, 'b> { }
impl<T> Trait<'_, '_> for T { }

// Here we wind up selecting `'a` and `'b` in the hidden type because
// those are the types that appear inth e original values.
// those are the types that appear in the original values.

fn upper_bounds<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a, 'b> {
// In this simple case, you have a hidden type `(&'0 u8, &'1 u8)` and constraints like
Expand Down

0 comments on commit 076b0d0

Please sign in to comment.