@@ -822,10 +822,10 @@ impl<'tcx> RegionInferenceContext<'tcx> {
822
822
continue ;
823
823
}
824
824
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 ;
829
829
}
830
830
831
831
// Type-test failed. Report the error.
@@ -1479,40 +1479,36 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1479
1479
shorter_fr : RegionVid ,
1480
1480
propagated_outlives_requirements : & mut Option < & mut Vec < ClosureOutlivesRequirement < ' tcx > > > ,
1481
1481
) -> RegionRelationCheckResult {
1482
- if let Some ( propagated_outlives_requirements) = propagated_outlives_requirements {
1482
+ if let Some ( propagated_outlives_requirements) = propagated_outlives_requirements
1483
1483
// Shrink `longer_fr` until we find a non-local region (if we do).
1484
1484
// We'll call it `fr-` -- it's ever so slightly smaller than
1485
1485
// `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) ;
1489
1489
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
+ ) ;
1495
1495
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
+ } ) ;
1515
1510
}
1511
+ return RegionRelationCheckResult :: Propagated ;
1516
1512
}
1517
1513
1518
1514
RegionRelationCheckResult :: Error
@@ -2085,11 +2081,11 @@ impl<'tcx> RegionInferenceContext<'tcx> {
2085
2081
let locations = self . scc_values . locations_outlived_by ( scc) ;
2086
2082
for location in locations {
2087
2083
let bb = & body[ location. block ] ;
2088
- if let Some ( terminator) = & bb. terminator {
2084
+ if let Some ( terminator) = & bb. terminator
2089
2085
// 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 ) ;
2093
2089
}
2094
2090
}
2095
2091
None
0 commit comments