@@ -245,11 +245,6 @@ enum Trace<'tcx> {
245245 NotVisited ,
246246}
247247
248- #[ derive( Clone , PartialEq , Eq , Debug ) ]
249- pub enum ExtraConstraintInfo {
250- PlaceholderFromPredicate ( Span ) ,
251- }
252-
253248impl < ' tcx > RegionInferenceContext < ' tcx > {
254249 /// Creates a new region inference context with a total of
255250 /// `num_region_variables` valid inference variables; the first N
@@ -1823,9 +1818,10 @@ impl<'tcx> RegionInferenceContext<'tcx> {
18231818 fr1_origin : NllRegionVariableOrigin ,
18241819 fr2 : RegionVid ,
18251820 ) -> ( ConstraintCategory < ' tcx > , ObligationCause < ' tcx > ) {
1826- let BlameConstraint { category, cause, .. } = self
1827- . best_blame_constraint ( fr1, fr1_origin, |r| self . provides_universal_region ( r, fr1, fr2) )
1828- . 0 ;
1821+ let BlameConstraint { category, cause, .. } =
1822+ self . best_blame_constraint ( fr1, fr1_origin, |r| {
1823+ self . provides_universal_region ( r, fr1, fr2)
1824+ } ) ;
18291825 ( category, cause)
18301826 }
18311827
@@ -2014,7 +2010,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
20142010 from_region : RegionVid ,
20152011 from_region_origin : NllRegionVariableOrigin ,
20162012 target_test : impl Fn ( RegionVid ) -> bool ,
2017- ) -> ( BlameConstraint < ' tcx > , Vec < ExtraConstraintInfo > ) {
2013+ ) -> BlameConstraint < ' tcx > {
20182014 // Find all paths
20192015 let ( path, target_region) =
20202016 self . find_constraint_paths_between_regions ( from_region, target_test) . unwrap ( ) ;
@@ -2030,18 +2026,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
20302026 . collect:: <Vec <_>>( )
20312027 ) ;
20322028
2033- let mut extra_info = vec ! [ ] ;
2034- for constraint in path. iter ( ) {
2035- let outlived = constraint. sub ;
2036- let Some ( origin) = self . var_infos . get ( outlived) else { continue ; } ;
2037- let RegionVariableOrigin :: Nll ( NllRegionVariableOrigin :: Placeholder ( p) ) = origin. origin else { continue ; } ;
2038- debug ! ( ?constraint, ?p) ;
2039- let ConstraintCategory :: Predicate ( span) = constraint. category else { continue ; } ;
2040- extra_info. push ( ExtraConstraintInfo :: PlaceholderFromPredicate ( span) ) ;
2041- // We only want to point to one
2042- break ;
2043- }
2044-
20452029 // We try to avoid reporting a `ConstraintCategory::Predicate` as our best constraint.
20462030 // Instead, we use it to produce an improved `ObligationCauseCode`.
20472031 // FIXME - determine what we should do if we encounter multiple `ConstraintCategory::Predicate`
@@ -2089,7 +2073,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
20892073 from_closure,
20902074 cause : ObligationCause :: new ( span, CRATE_HIR_ID , cause_code) ,
20912075 variance_info : constraint. variance_info ,
2092- outlives_constraint : * constraint,
20932076 }
20942077 } )
20952078 . collect ( ) ;
@@ -2191,7 +2174,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
21912174 let best_choice =
21922175 if blame_source { range. rev ( ) . find ( find_region) } else { range. find ( find_region) } ;
21932176
2194- debug ! ( ?best_choice, ?blame_source, ?extra_info ) ;
2177+ debug ! ( ?best_choice, ?blame_source) ;
21952178
21962179 if let Some ( i) = best_choice {
21972180 if let Some ( next) = categorized_path. get ( i + 1 ) {
@@ -2200,7 +2183,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
22002183 {
22012184 // The return expression is being influenced by the return type being
22022185 // impl Trait, point at the return type and not the return expr.
2203- return ( next. clone ( ) , extra_info ) ;
2186+ return next. clone ( ) ;
22042187 }
22052188 }
22062189
@@ -2220,7 +2203,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
22202203 }
22212204 }
22222205
2223- return ( categorized_path[ i] . clone ( ) , extra_info ) ;
2206+ return categorized_path[ i] . clone ( ) ;
22242207 }
22252208
22262209 // If that search fails, that is.. unusual. Maybe everything
@@ -2230,7 +2213,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
22302213 categorized_path. sort_by ( |p0, p1| p0. category . cmp ( & p1. category ) ) ;
22312214 debug ! ( "sorted_path={:#?}" , categorized_path) ;
22322215
2233- ( categorized_path. remove ( 0 ) , extra_info )
2216+ categorized_path. remove ( 0 )
22342217 }
22352218
22362219 pub ( crate ) fn universe_info ( & self , universe : ty:: UniverseIndex ) -> UniverseInfo < ' tcx > {
@@ -2312,13 +2295,7 @@ impl<'tcx> ClosureRegionRequirementsExt<'tcx> for ClosureRegionRequirements<'tcx
23122295 outlives_requirement={:?}",
23132296 region, outlived_region, outlives_requirement,
23142297 ) ;
2315- (
2316- ty:: Binder :: dummy ( ty:: OutlivesPredicate (
2317- region. into ( ) ,
2318- outlived_region,
2319- ) ) ,
2320- ConstraintCategory :: BoringNoLocation ,
2321- )
2298+ ty:: Binder :: dummy ( ty:: OutlivesPredicate ( region. into ( ) , outlived_region) )
23222299 }
23232300
23242301 ClosureOutlivesSubject :: Ty ( ty) => {
@@ -2328,10 +2305,7 @@ impl<'tcx> ClosureRegionRequirementsExt<'tcx> for ClosureRegionRequirements<'tcx
23282305 outlives_requirement={:?}",
23292306 ty, outlived_region, outlives_requirement,
23302307 ) ;
2331- (
2332- ty:: Binder :: dummy ( ty:: OutlivesPredicate ( ty. into ( ) , outlived_region) ) ,
2333- ConstraintCategory :: BoringNoLocation ,
2334- )
2308+ ty:: Binder :: dummy ( ty:: OutlivesPredicate ( ty. into ( ) , outlived_region) )
23352309 }
23362310 }
23372311 } )
@@ -2345,5 +2319,4 @@ pub struct BlameConstraint<'tcx> {
23452319 pub from_closure : bool ,
23462320 pub cause : ObligationCause < ' tcx > ,
23472321 pub variance_info : ty:: VarianceDiagInfo < ' tcx > ,
2348- pub outlives_constraint : OutlivesConstraint < ' tcx > ,
23492322}
0 commit comments