@@ -245,11 +245,6 @@ enum Trace<'tcx> {
245
245
NotVisited ,
246
246
}
247
247
248
- #[ derive( Clone , PartialEq , Eq , Debug ) ]
249
- pub enum ExtraConstraintInfo {
250
- PlaceholderFromPredicate ( Span ) ,
251
- }
252
-
253
248
impl < ' tcx > RegionInferenceContext < ' tcx > {
254
249
/// Creates a new region inference context with a total of
255
250
/// `num_region_variables` valid inference variables; the first N
@@ -1823,9 +1818,10 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1823
1818
fr1_origin : NllRegionVariableOrigin ,
1824
1819
fr2 : RegionVid ,
1825
1820
) -> ( 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
+ } ) ;
1829
1825
( category, cause)
1830
1826
}
1831
1827
@@ -2014,7 +2010,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
2014
2010
from_region : RegionVid ,
2015
2011
from_region_origin : NllRegionVariableOrigin ,
2016
2012
target_test : impl Fn ( RegionVid ) -> bool ,
2017
- ) -> ( BlameConstraint < ' tcx > , Vec < ExtraConstraintInfo > ) {
2013
+ ) -> BlameConstraint < ' tcx > {
2018
2014
// Find all paths
2019
2015
let ( path, target_region) =
2020
2016
self . find_constraint_paths_between_regions ( from_region, target_test) . unwrap ( ) ;
@@ -2030,18 +2026,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
2030
2026
. collect:: <Vec <_>>( )
2031
2027
) ;
2032
2028
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
-
2045
2029
// We try to avoid reporting a `ConstraintCategory::Predicate` as our best constraint.
2046
2030
// Instead, we use it to produce an improved `ObligationCauseCode`.
2047
2031
// FIXME - determine what we should do if we encounter multiple `ConstraintCategory::Predicate`
@@ -2089,7 +2073,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
2089
2073
from_closure,
2090
2074
cause : ObligationCause :: new ( span, CRATE_HIR_ID , cause_code) ,
2091
2075
variance_info : constraint. variance_info ,
2092
- outlives_constraint : * constraint,
2093
2076
}
2094
2077
} )
2095
2078
. collect ( ) ;
@@ -2191,7 +2174,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
2191
2174
let best_choice =
2192
2175
if blame_source { range. rev ( ) . find ( find_region) } else { range. find ( find_region) } ;
2193
2176
2194
- debug ! ( ?best_choice, ?blame_source, ?extra_info ) ;
2177
+ debug ! ( ?best_choice, ?blame_source) ;
2195
2178
2196
2179
if let Some ( i) = best_choice {
2197
2180
if let Some ( next) = categorized_path. get ( i + 1 ) {
@@ -2200,7 +2183,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
2200
2183
{
2201
2184
// The return expression is being influenced by the return type being
2202
2185
// impl Trait, point at the return type and not the return expr.
2203
- return ( next. clone ( ) , extra_info ) ;
2186
+ return next. clone ( ) ;
2204
2187
}
2205
2188
}
2206
2189
@@ -2220,7 +2203,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
2220
2203
}
2221
2204
}
2222
2205
2223
- return ( categorized_path[ i] . clone ( ) , extra_info ) ;
2206
+ return categorized_path[ i] . clone ( ) ;
2224
2207
}
2225
2208
2226
2209
// If that search fails, that is.. unusual. Maybe everything
@@ -2230,7 +2213,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
2230
2213
categorized_path. sort_by ( |p0, p1| p0. category . cmp ( & p1. category ) ) ;
2231
2214
debug ! ( "sorted_path={:#?}" , categorized_path) ;
2232
2215
2233
- ( categorized_path. remove ( 0 ) , extra_info )
2216
+ categorized_path. remove ( 0 )
2234
2217
}
2235
2218
2236
2219
pub ( crate ) fn universe_info ( & self , universe : ty:: UniverseIndex ) -> UniverseInfo < ' tcx > {
@@ -2312,13 +2295,7 @@ impl<'tcx> ClosureRegionRequirementsExt<'tcx> for ClosureRegionRequirements<'tcx
2312
2295
outlives_requirement={:?}",
2313
2296
region, outlived_region, outlives_requirement,
2314
2297
) ;
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) )
2322
2299
}
2323
2300
2324
2301
ClosureOutlivesSubject :: Ty ( ty) => {
@@ -2328,10 +2305,7 @@ impl<'tcx> ClosureRegionRequirementsExt<'tcx> for ClosureRegionRequirements<'tcx
2328
2305
outlives_requirement={:?}",
2329
2306
ty, outlived_region, outlives_requirement,
2330
2307
) ;
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) )
2335
2309
}
2336
2310
}
2337
2311
} )
@@ -2345,5 +2319,4 @@ pub struct BlameConstraint<'tcx> {
2345
2319
pub from_closure : bool ,
2346
2320
pub cause : ObligationCause < ' tcx > ,
2347
2321
pub variance_info : ty:: VarianceDiagInfo < ' tcx > ,
2348
- pub outlives_constraint : OutlivesConstraint < ' tcx > ,
2349
2322
}
0 commit comments