@@ -590,13 +590,12 @@ impl<'tcx> RegionInferenceContext<'tcx> {
590590 // constraints were too strong, and if so, emit or propagate those errors.
591591 if infcx. tcx . sess . opts . unstable_opts . polonius {
592592 self . check_polonius_subset_errors (
593- body,
594593 outlives_requirements. as_mut ( ) ,
595594 & mut errors_buffer,
596595 polonius_output. expect ( "Polonius output is unavailable despite `-Z polonius`" ) ,
597596 ) ;
598597 } 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) ;
600599 }
601600
602601 if errors_buffer. is_empty ( ) {
@@ -1409,7 +1408,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
14091408 /// report them as errors.
14101409 fn check_universal_regions (
14111410 & self ,
1412- body : & Body < ' tcx > ,
14131411 mut propagated_outlives_requirements : Option < & mut Vec < ClosureOutlivesRequirement < ' tcx > > > ,
14141412 errors_buffer : & mut RegionErrors < ' tcx > ,
14151413 ) {
@@ -1420,7 +1418,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
14201418 // they did not grow too large, accumulating any requirements
14211419 // for our caller into the `outlives_requirements` vector.
14221420 self . check_universal_region (
1423- body,
14241421 fr,
14251422 & mut propagated_outlives_requirements,
14261423 errors_buffer,
@@ -1461,7 +1458,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
14611458 /// report them as errors.
14621459 fn check_polonius_subset_errors (
14631460 & self ,
1464- body : & Body < ' tcx > ,
14651461 mut propagated_outlives_requirements : Option < & mut Vec < ClosureOutlivesRequirement < ' tcx > > > ,
14661462 errors_buffer : & mut RegionErrors < ' tcx > ,
14671463 polonius_output : Rc < PoloniusOutput > ,
@@ -1508,7 +1504,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
15081504 let propagated = self . try_propagate_universal_region_error (
15091505 * longer_fr,
15101506 * shorter_fr,
1511- body,
15121507 & mut propagated_outlives_requirements,
15131508 ) ;
15141509 if propagated == RegionRelationCheckResult :: Error {
@@ -1548,13 +1543,9 @@ impl<'tcx> RegionInferenceContext<'tcx> {
15481543 ///
15491544 /// Things that are to be propagated are accumulated into the
15501545 /// `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" ) ]
15551547 fn check_universal_region (
15561548 & self ,
1557- body : & Body < ' tcx > ,
15581549 longer_fr : RegionVid ,
15591550 propagated_outlives_requirements : & mut Option < & mut Vec < ClosureOutlivesRequirement < ' tcx > > > ,
15601551 errors_buffer : & mut RegionErrors < ' tcx > ,
@@ -1577,7 +1568,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
15771568 if let RegionRelationCheckResult :: Error = self . check_universal_region_relation (
15781569 longer_fr,
15791570 representative,
1580- body,
15811571 propagated_outlives_requirements,
15821572 ) {
15831573 errors_buffer. push ( RegionErrorKind :: RegionError {
@@ -1597,7 +1587,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
15971587 if let RegionRelationCheckResult :: Error = self . check_universal_region_relation (
15981588 longer_fr,
15991589 shorter_fr,
1600- body,
16011590 propagated_outlives_requirements,
16021591 ) {
16031592 // We only report the first region error. Subsequent errors are hidden so as
@@ -1622,7 +1611,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
16221611 & self ,
16231612 longer_fr : RegionVid ,
16241613 shorter_fr : RegionVid ,
1625- body : & Body < ' tcx > ,
16261614 propagated_outlives_requirements : & mut Option < & mut Vec < ClosureOutlivesRequirement < ' tcx > > > ,
16271615 ) -> RegionRelationCheckResult {
16281616 // If it is known that `fr: o`, carry on.
@@ -1638,7 +1626,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
16381626 self . try_propagate_universal_region_error (
16391627 longer_fr,
16401628 shorter_fr,
1641- body,
16421629 propagated_outlives_requirements,
16431630 )
16441631 }
@@ -1650,7 +1637,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
16501637 & self ,
16511638 longer_fr : RegionVid ,
16521639 shorter_fr : RegionVid ,
1653- body : & Body < ' tcx > ,
16541640 propagated_outlives_requirements : & mut Option < & mut Vec < ClosureOutlivesRequirement < ' tcx > > > ,
16551641 ) -> RegionRelationCheckResult {
16561642 if let Some ( propagated_outlives_requirements) = propagated_outlives_requirements {
@@ -1662,7 +1648,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
16621648 debug ! ( "try_propagate_universal_region_error: fr_minus={:?}" , fr_minus) ;
16631649
16641650 let blame_span_category = self . find_outlives_blame_span (
1665- body,
16661651 longer_fr,
16671652 NllRegionVariableOrigin :: FreeRegion ,
16681653 shorter_fr,
@@ -1816,7 +1801,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
18161801
18171802 pub ( crate ) fn retrieve_closure_constraint_info (
18181803 & self ,
1819- _body : & Body < ' tcx > ,
18201804 constraint : & OutlivesConstraint < ' tcx > ,
18211805 ) -> BlameConstraint < ' tcx > {
18221806 let loc = match constraint. locations {
@@ -1851,13 +1835,12 @@ impl<'tcx> RegionInferenceContext<'tcx> {
18511835 /// Finds a good `ObligationCause` to blame for the fact that `fr1` outlives `fr2`.
18521836 pub ( crate ) fn find_outlives_blame_span (
18531837 & self ,
1854- body : & Body < ' tcx > ,
18551838 fr1 : RegionVid ,
18561839 fr1_origin : NllRegionVariableOrigin ,
18571840 fr2 : RegionVid ,
18581841 ) -> ( ConstraintCategory < ' tcx > , ObligationCause < ' tcx > ) {
18591842 let BlameConstraint { category, cause, .. } =
1860- self . best_blame_constraint ( body , fr1, fr1_origin, |r| {
1843+ self . best_blame_constraint ( fr1, fr1_origin, |r| {
18611844 self . provides_universal_region ( r, fr1, fr2)
18621845 } ) ;
18631846 ( category, cause)
@@ -2045,7 +2028,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
20452028 #[ instrument( level = "debug" , skip( self , target_test) ) ]
20462029 pub ( crate ) fn best_blame_constraint (
20472030 & self ,
2048- body : & Body < ' tcx > ,
20492031 from_region : RegionVid ,
20502032 from_region_origin : NllRegionVariableOrigin ,
20512033 target_test : impl Fn ( RegionVid ) -> bool ,
@@ -2091,7 +2073,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
20912073 . iter ( )
20922074 . map ( |constraint| {
20932075 if constraint. category == ConstraintCategory :: ClosureBounds {
2094- self . retrieve_closure_constraint_info ( body , & constraint)
2076+ self . retrieve_closure_constraint_info ( & constraint)
20952077 } else {
20962078 BlameConstraint {
20972079 category : constraint. category ,
0 commit comments