Skip to content
Permalink
Browse files

more nits + typos

  • Loading branch information...
nikomatsakis committed Jun 24, 2019
1 parent 9217909 commit 076b0d0f5cc33f108fda043c2e6e12229d734cf4
@@ -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(
@@ -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(
@@ -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.
@@ -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),

// -------------------------------------------------------------------------
@@ -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>;

@@ -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

0 comments on commit 076b0d0

Please sign in to comment.
You can’t perform that action at this time.