@@ -245,6 +245,9 @@ enum Trace<'tcx> {
245245 NotVisited ,
246246}
247247
248+ #[ derive( Clone , PartialEq , Eq , Debug ) ]
249+ pub enum ExtraConstraintInfo { }
250+
248251impl < ' tcx > RegionInferenceContext < ' tcx > {
249252 /// Creates a new region inference context with a total of
250253 /// `num_region_variables` valid inference variables; the first N
@@ -1818,10 +1821,9 @@ impl<'tcx> RegionInferenceContext<'tcx> {
18181821 fr1_origin : NllRegionVariableOrigin ,
18191822 fr2 : RegionVid ,
18201823 ) -> ( ConstraintCategory < ' tcx > , ObligationCause < ' tcx > ) {
1821- let BlameConstraint { category, cause, .. } =
1822- self . best_blame_constraint ( fr1, fr1_origin, |r| {
1823- self . provides_universal_region ( r, fr1, fr2)
1824- } ) ;
1824+ let BlameConstraint { category, cause, .. } = self
1825+ . best_blame_constraint ( fr1, fr1_origin, |r| self . provides_universal_region ( r, fr1, fr2) )
1826+ . 0 ;
18251827 ( category, cause)
18261828 }
18271829
@@ -2010,7 +2012,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
20102012 from_region : RegionVid ,
20112013 from_region_origin : NllRegionVariableOrigin ,
20122014 target_test : impl Fn ( RegionVid ) -> bool ,
2013- ) -> BlameConstraint < ' tcx > {
2015+ ) -> ( BlameConstraint < ' tcx > , Vec < ExtraConstraintInfo > ) {
20142016 // Find all paths
20152017 let ( path, target_region) =
20162018 self . find_constraint_paths_between_regions ( from_region, target_test) . unwrap ( ) ;
@@ -2026,6 +2028,8 @@ impl<'tcx> RegionInferenceContext<'tcx> {
20262028 . collect:: <Vec <_>>( )
20272029 ) ;
20282030
2031+ let extra_info = vec ! [ ] ;
2032+
20292033 // We try to avoid reporting a `ConstraintCategory::Predicate` as our best constraint.
20302034 // Instead, we use it to produce an improved `ObligationCauseCode`.
20312035 // FIXME - determine what we should do if we encounter multiple `ConstraintCategory::Predicate`
@@ -2175,7 +2179,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
21752179 let best_choice =
21762180 if blame_source { range. rev ( ) . find ( find_region) } else { range. find ( find_region) } ;
21772181
2178- debug ! ( ?best_choice, ?blame_source) ;
2182+ debug ! ( ?best_choice, ?blame_source, ?extra_info ) ;
21792183
21802184 if let Some ( i) = best_choice {
21812185 if let Some ( next) = categorized_path. get ( i + 1 ) {
@@ -2184,7 +2188,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
21842188 {
21852189 // The return expression is being influenced by the return type being
21862190 // impl Trait, point at the return type and not the return expr.
2187- return next. clone ( ) ;
2191+ return ( next. clone ( ) , extra_info ) ;
21882192 }
21892193 }
21902194
@@ -2204,7 +2208,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
22042208 }
22052209 }
22062210
2207- return categorized_path[ i] . clone ( ) ;
2211+ return ( categorized_path[ i] . clone ( ) , extra_info ) ;
22082212 }
22092213
22102214 // If that search fails, that is.. unusual. Maybe everything
@@ -2214,7 +2218,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
22142218 categorized_path. sort_by ( |p0, p1| p0. category . cmp ( & p1. category ) ) ;
22152219 debug ! ( "sorted_path={:#?}" , categorized_path) ;
22162220
2217- categorized_path. remove ( 0 )
2221+ ( categorized_path. remove ( 0 ) , extra_info )
22182222 }
22192223
22202224 pub ( crate ) fn universe_info ( & self , universe : ty:: UniverseIndex ) -> UniverseInfo < ' tcx > {
0 commit comments