@@ -590,13 +590,12 @@ impl<'tcx> RegionInferenceContext<'tcx> {
590
590
// constraints were too strong, and if so, emit or propagate those errors.
591
591
if infcx. tcx . sess . opts . unstable_opts . polonius {
592
592
self . check_polonius_subset_errors (
593
- body,
594
593
outlives_requirements. as_mut ( ) ,
595
594
& mut errors_buffer,
596
595
polonius_output. expect ( "Polonius output is unavailable despite `-Z polonius`" ) ,
597
596
) ;
598
597
} else {
599
- self . check_universal_regions ( body , outlives_requirements. as_mut ( ) , & mut errors_buffer) ;
598
+ self . check_universal_regions ( outlives_requirements. as_mut ( ) , & mut errors_buffer) ;
600
599
}
601
600
602
601
if errors_buffer. is_empty ( ) {
@@ -1409,7 +1408,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1409
1408
/// report them as errors.
1410
1409
fn check_universal_regions (
1411
1410
& self ,
1412
- body : & Body < ' tcx > ,
1413
1411
mut propagated_outlives_requirements : Option < & mut Vec < ClosureOutlivesRequirement < ' tcx > > > ,
1414
1412
errors_buffer : & mut RegionErrors < ' tcx > ,
1415
1413
) {
@@ -1420,7 +1418,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1420
1418
// they did not grow too large, accumulating any requirements
1421
1419
// for our caller into the `outlives_requirements` vector.
1422
1420
self . check_universal_region (
1423
- body,
1424
1421
fr,
1425
1422
& mut propagated_outlives_requirements,
1426
1423
errors_buffer,
@@ -1461,7 +1458,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1461
1458
/// report them as errors.
1462
1459
fn check_polonius_subset_errors (
1463
1460
& self ,
1464
- body : & Body < ' tcx > ,
1465
1461
mut propagated_outlives_requirements : Option < & mut Vec < ClosureOutlivesRequirement < ' tcx > > > ,
1466
1462
errors_buffer : & mut RegionErrors < ' tcx > ,
1467
1463
polonius_output : Rc < PoloniusOutput > ,
@@ -1508,7 +1504,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1508
1504
let propagated = self . try_propagate_universal_region_error (
1509
1505
* longer_fr,
1510
1506
* shorter_fr,
1511
- body,
1512
1507
& mut propagated_outlives_requirements,
1513
1508
) ;
1514
1509
if propagated == RegionRelationCheckResult :: Error {
@@ -1548,13 +1543,9 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1548
1543
///
1549
1544
/// Things that are to be propagated are accumulated into the
1550
1545
/// `outlives_requirements` vector.
1551
- #[ instrument(
1552
- skip( self , body, propagated_outlives_requirements, errors_buffer) ,
1553
- level = "debug"
1554
- ) ]
1546
+ #[ instrument( skip( self , propagated_outlives_requirements, errors_buffer) , level = "debug" ) ]
1555
1547
fn check_universal_region (
1556
1548
& self ,
1557
- body : & Body < ' tcx > ,
1558
1549
longer_fr : RegionVid ,
1559
1550
propagated_outlives_requirements : & mut Option < & mut Vec < ClosureOutlivesRequirement < ' tcx > > > ,
1560
1551
errors_buffer : & mut RegionErrors < ' tcx > ,
@@ -1577,7 +1568,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1577
1568
if let RegionRelationCheckResult :: Error = self . check_universal_region_relation (
1578
1569
longer_fr,
1579
1570
representative,
1580
- body,
1581
1571
propagated_outlives_requirements,
1582
1572
) {
1583
1573
errors_buffer. push ( RegionErrorKind :: RegionError {
@@ -1597,7 +1587,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1597
1587
if let RegionRelationCheckResult :: Error = self . check_universal_region_relation (
1598
1588
longer_fr,
1599
1589
shorter_fr,
1600
- body,
1601
1590
propagated_outlives_requirements,
1602
1591
) {
1603
1592
// We only report the first region error. Subsequent errors are hidden so as
@@ -1622,7 +1611,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1622
1611
& self ,
1623
1612
longer_fr : RegionVid ,
1624
1613
shorter_fr : RegionVid ,
1625
- body : & Body < ' tcx > ,
1626
1614
propagated_outlives_requirements : & mut Option < & mut Vec < ClosureOutlivesRequirement < ' tcx > > > ,
1627
1615
) -> RegionRelationCheckResult {
1628
1616
// If it is known that `fr: o`, carry on.
@@ -1638,7 +1626,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1638
1626
self . try_propagate_universal_region_error (
1639
1627
longer_fr,
1640
1628
shorter_fr,
1641
- body,
1642
1629
propagated_outlives_requirements,
1643
1630
)
1644
1631
}
@@ -1650,7 +1637,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1650
1637
& self ,
1651
1638
longer_fr : RegionVid ,
1652
1639
shorter_fr : RegionVid ,
1653
- body : & Body < ' tcx > ,
1654
1640
propagated_outlives_requirements : & mut Option < & mut Vec < ClosureOutlivesRequirement < ' tcx > > > ,
1655
1641
) -> RegionRelationCheckResult {
1656
1642
if let Some ( propagated_outlives_requirements) = propagated_outlives_requirements {
@@ -1662,7 +1648,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1662
1648
debug ! ( "try_propagate_universal_region_error: fr_minus={:?}" , fr_minus) ;
1663
1649
1664
1650
let blame_span_category = self . find_outlives_blame_span (
1665
- body,
1666
1651
longer_fr,
1667
1652
NllRegionVariableOrigin :: FreeRegion ,
1668
1653
shorter_fr,
@@ -1816,7 +1801,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1816
1801
1817
1802
pub ( crate ) fn retrieve_closure_constraint_info (
1818
1803
& self ,
1819
- _body : & Body < ' tcx > ,
1820
1804
constraint : & OutlivesConstraint < ' tcx > ,
1821
1805
) -> BlameConstraint < ' tcx > {
1822
1806
let loc = match constraint. locations {
@@ -1851,13 +1835,12 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1851
1835
/// Finds a good `ObligationCause` to blame for the fact that `fr1` outlives `fr2`.
1852
1836
pub ( crate ) fn find_outlives_blame_span (
1853
1837
& self ,
1854
- body : & Body < ' tcx > ,
1855
1838
fr1 : RegionVid ,
1856
1839
fr1_origin : NllRegionVariableOrigin ,
1857
1840
fr2 : RegionVid ,
1858
1841
) -> ( ConstraintCategory < ' tcx > , ObligationCause < ' tcx > ) {
1859
1842
let BlameConstraint { category, cause, .. } =
1860
- self . best_blame_constraint ( body , fr1, fr1_origin, |r| {
1843
+ self . best_blame_constraint ( fr1, fr1_origin, |r| {
1861
1844
self . provides_universal_region ( r, fr1, fr2)
1862
1845
} ) ;
1863
1846
( category, cause)
@@ -2045,7 +2028,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
2045
2028
#[ instrument( level = "debug" , skip( self , target_test) ) ]
2046
2029
pub ( crate ) fn best_blame_constraint (
2047
2030
& self ,
2048
- body : & Body < ' tcx > ,
2049
2031
from_region : RegionVid ,
2050
2032
from_region_origin : NllRegionVariableOrigin ,
2051
2033
target_test : impl Fn ( RegionVid ) -> bool ,
@@ -2091,7 +2073,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
2091
2073
. iter ( )
2092
2074
. map ( |constraint| {
2093
2075
if constraint. category == ConstraintCategory :: ClosureBounds {
2094
- self . retrieve_closure_constraint_info ( body , & constraint)
2076
+ self . retrieve_closure_constraint_info ( & constraint)
2095
2077
} else {
2096
2078
BlameConstraint {
2097
2079
category : constraint. category ,
0 commit comments