提交 b7f87136 编写于 作者: N Niko Matsakis

region_infer: rustfmt

上级 8eb789f4
...@@ -686,7 +686,6 @@ fn try_promote_type_test<'gcx>( ...@@ -686,7 +686,6 @@ fn try_promote_type_test<'gcx>(
test: _, test: _,
} = type_test; } = type_test;
let generic_ty = generic_kind.to_ty(tcx); let generic_ty = generic_kind.to_ty(tcx);
let subject = match self.try_promote_type_test_subject(infcx, generic_ty) { let subject = match self.try_promote_type_test_subject(infcx, generic_ty) {
Some(s) => s, Some(s) => s,
...@@ -704,11 +703,7 @@ fn try_promote_type_test<'gcx>( ...@@ -704,11 +703,7 @@ fn try_promote_type_test<'gcx>(
debug!("try_promote_type_test: non_local_ub={:?}", non_local_ub); debug!("try_promote_type_test: non_local_ub={:?}", non_local_ub);
assert!(self.universal_regions.is_universal_region(non_local_ub)); assert!(self.universal_regions.is_universal_region(non_local_ub));
assert!( assert!(!self.universal_regions.is_local_free_region(non_local_ub));
!self
.universal_regions
.is_local_free_region(non_local_ub)
);
let requirement = ClosureOutlivesRequirement { let requirement = ClosureOutlivesRequirement {
subject, subject,
...@@ -922,8 +917,7 @@ fn eval_outlives( ...@@ -922,8 +917,7 @@ fn eval_outlives(
// now). Therefore, the sup-region outlives the sub-region if, // now). Therefore, the sup-region outlives the sub-region if,
// for each universal region R1 in the sub-region, there // for each universal region R1 in the sub-region, there
// exists some region R2 in the sup-region that outlives R1. // exists some region R2 in the sup-region that outlives R1.
let universal_outlives = self let universal_outlives = self.scc_values
.scc_values
.universal_regions_outlived_by(sub_region_scc) .universal_regions_outlived_by(sub_region_scc)
.all(|r1| { .all(|r1| {
self.scc_values self.scc_values
...@@ -1034,8 +1028,7 @@ fn check_universal_region<'gcx>( ...@@ -1034,8 +1028,7 @@ fn check_universal_region<'gcx>(
// (because `fr` includes `end(o)`). // (because `fr` includes `end(o)`).
for shorter_fr in self.scc_values.universal_regions_outlived_by(longer_fr_scc) { for shorter_fr in self.scc_values.universal_regions_outlived_by(longer_fr_scc) {
// If it is known that `fr: o`, carry on. // If it is known that `fr: o`, carry on.
if self if self.universal_region_relations
.universal_region_relations
.outlives(longer_fr, shorter_fr) .outlives(longer_fr, shorter_fr)
{ {
continue; continue;
...@@ -1051,8 +1044,7 @@ fn check_universal_region<'gcx>( ...@@ -1051,8 +1044,7 @@ fn check_universal_region<'gcx>(
if let Some(propagated_outlives_requirements) = propagated_outlives_requirements { if let Some(propagated_outlives_requirements) = propagated_outlives_requirements {
// Shrink `fr` until we find a non-local region (if we do). // Shrink `fr` until we find a non-local region (if we do).
// We'll call that `fr-` -- it's ever so slightly smaller than `fr`. // We'll call that `fr-` -- it's ever so slightly smaller than `fr`.
if let Some(fr_minus) = self if let Some(fr_minus) = self.universal_region_relations
.universal_region_relations
.non_local_lower_bound(longer_fr) .non_local_lower_bound(longer_fr)
{ {
debug!("check_universal_region: fr_minus={:?}", fr_minus); debug!("check_universal_region: fr_minus={:?}", fr_minus);
...@@ -1061,8 +1053,7 @@ fn check_universal_region<'gcx>( ...@@ -1061,8 +1053,7 @@ fn check_universal_region<'gcx>(
// region. (We always will.) We'll call that // region. (We always will.) We'll call that
// `shorter_fr+` -- it's ever so slightly larger than // `shorter_fr+` -- it's ever so slightly larger than
// `fr`. // `fr`.
let shorter_fr_plus = self let shorter_fr_plus = self.universal_region_relations
.universal_region_relations
.non_local_upper_bound(shorter_fr); .non_local_upper_bound(shorter_fr);
debug!( debug!(
"check_universal_region: shorter_fr_plus={:?}", "check_universal_region: shorter_fr_plus={:?}",
...@@ -1122,8 +1113,7 @@ fn check_bound_universal_region<'gcx>( ...@@ -1122,8 +1113,7 @@ fn check_bound_universal_region<'gcx>(
let error_region = match error_element { let error_region = match error_element {
RegionElement::Location(l) => self.find_sub_region_live_at(longer_fr, l), RegionElement::Location(l) => self.find_sub_region_live_at(longer_fr, l),
RegionElement::RootUniversalRegion(r) => r, RegionElement::RootUniversalRegion(r) => r,
RegionElement::SubUniversalRegion(error_ui) => self RegionElement::SubUniversalRegion(error_ui) => self.definitions
.definitions
.iter_enumerated() .iter_enumerated()
.filter_map(|(r, definition)| match definition.origin { .filter_map(|(r, definition)| match definition.origin {
NLLRegionVariableOrigin::BoundRegion(ui) if error_ui == ui => Some(r), NLLRegionVariableOrigin::BoundRegion(ui) if error_ui == ui => Some(r),
...@@ -1220,7 +1210,11 @@ fn apply_requirements( ...@@ -1220,7 +1210,11 @@ fn apply_requirements(
// into a vector. These are the regions that we will be // into a vector. These are the regions that we will be
// relating to one another. // relating to one another.
let closure_mapping = &UniversalRegions::closure_mapping( let closure_mapping = &UniversalRegions::closure_mapping(
tcx, user_closure_ty, self.num_external_vids, tcx.closure_base_def_id(closure_def_id)); tcx,
user_closure_ty,
self.num_external_vids,
tcx.closure_base_def_id(closure_def_id),
);
debug!("apply_requirements: closure_mapping={:?}", closure_mapping); debug!("apply_requirements: closure_mapping={:?}", closure_mapping);
// Create the predicates. // Create the predicates.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册