@@ -822,10 +822,10 @@ impl<'tcx> RegionInferenceContext<'tcx> {
822822 continue ;
823823 }
824824
825- if let Some ( propagated_outlives_requirements) = & mut propagated_outlives_requirements {
826- if self . try_promote_type_test ( infcx, type_test, propagated_outlives_requirements) {
827- continue ;
828- }
825+ if let Some ( propagated_outlives_requirements) = & mut propagated_outlives_requirements
826+ && self . try_promote_type_test ( infcx, type_test, propagated_outlives_requirements)
827+ {
828+ continue ;
829829 }
830830
831831 // Type-test failed. Report the error.
@@ -1479,40 +1479,36 @@ impl<'tcx> RegionInferenceContext<'tcx> {
14791479 shorter_fr : RegionVid ,
14801480 propagated_outlives_requirements : & mut Option < & mut Vec < ClosureOutlivesRequirement < ' tcx > > > ,
14811481 ) -> RegionRelationCheckResult {
1482- if let Some ( propagated_outlives_requirements) = propagated_outlives_requirements {
1482+ if let Some ( propagated_outlives_requirements) = propagated_outlives_requirements
14831483 // Shrink `longer_fr` until we find a non-local region (if we do).
14841484 // We'll call it `fr-` -- it's ever so slightly smaller than
14851485 // `longer_fr`.
1486- if let Some ( fr_minus) = self . universal_region_relations . non_local_lower_bound ( longer_fr)
1487- {
1488- debug ! ( "try_propagate_universal_region_error: fr_minus={:?}" , fr_minus) ;
1486+ && let Some ( fr_minus) = self . universal_region_relations . non_local_lower_bound ( longer_fr)
1487+ {
1488+ debug ! ( "try_propagate_universal_region_error: fr_minus={:?}" , fr_minus) ;
14891489
1490- let blame_span_category = self . find_outlives_blame_span (
1491- longer_fr,
1492- NllRegionVariableOrigin :: FreeRegion ,
1493- shorter_fr,
1494- ) ;
1490+ let blame_span_category = self . find_outlives_blame_span (
1491+ longer_fr,
1492+ NllRegionVariableOrigin :: FreeRegion ,
1493+ shorter_fr,
1494+ ) ;
14951495
1496- // Grow `shorter_fr` until we find some non-local regions. (We
1497- // always will.) We'll call them `shorter_fr+` -- they're ever
1498- // so slightly larger than `shorter_fr`.
1499- let shorter_fr_plus =
1500- self . universal_region_relations . non_local_upper_bounds ( shorter_fr) ;
1501- debug ! (
1502- "try_propagate_universal_region_error: shorter_fr_plus={:?}" ,
1503- shorter_fr_plus
1504- ) ;
1505- for fr in shorter_fr_plus {
1506- // Push the constraint `fr-: shorter_fr+`
1507- propagated_outlives_requirements. push ( ClosureOutlivesRequirement {
1508- subject : ClosureOutlivesSubject :: Region ( fr_minus) ,
1509- outlived_free_region : fr,
1510- blame_span : blame_span_category. 1 . span ,
1511- category : blame_span_category. 0 ,
1512- } ) ;
1513- }
1514- return RegionRelationCheckResult :: Propagated ;
1496+ // Grow `shorter_fr` until we find some non-local regions. (We
1497+ // always will.) We'll call them `shorter_fr+` -- they're ever
1498+ // so slightly larger than `shorter_fr`.
1499+ let shorter_fr_plus =
1500+ self . universal_region_relations . non_local_upper_bounds ( shorter_fr) ;
1501+ debug ! ( "try_propagate_universal_region_error: shorter_fr_plus={:?}" , shorter_fr_plus) ;
1502+ for fr in shorter_fr_plus {
1503+ // Push the constraint `fr-: shorter_fr+`
1504+ propagated_outlives_requirements. push ( ClosureOutlivesRequirement {
1505+ subject : ClosureOutlivesSubject :: Region ( fr_minus) ,
1506+ outlived_free_region : fr,
1507+ blame_span : blame_span_category. 1 . span ,
1508+ category : blame_span_category. 0 ,
1509+ } ) ;
15151510 }
1511+ return RegionRelationCheckResult :: Propagated ;
15161512 }
15171513
15181514 RegionRelationCheckResult :: Error
@@ -2085,11 +2081,11 @@ impl<'tcx> RegionInferenceContext<'tcx> {
20852081 let locations = self . scc_values . locations_outlived_by ( scc) ;
20862082 for location in locations {
20872083 let bb = & body[ location. block ] ;
2088- if let Some ( terminator) = & bb. terminator {
2084+ if let Some ( terminator) = & bb. terminator
20892085 // terminator of a loop should be TerminatorKind::FalseUnwind
2090- if let TerminatorKind :: FalseUnwind { .. } = terminator. kind {
2091- return Some ( location ) ;
2092- }
2086+ && let TerminatorKind :: FalseUnwind { .. } = terminator. kind
2087+ {
2088+ return Some ( location ) ;
20932089 }
20942090 }
20952091 None
0 commit comments