@@ -9,7 +9,6 @@ use rustc_errors::{Applicability, ErrorGuaranteed, pluralize, struct_span_code_e
9
9
use rustc_hir:: def:: { DefKind , Res } ;
10
10
use rustc_hir:: intravisit:: VisitorExt ;
11
11
use rustc_hir:: { self as hir, AmbigArg , GenericParamKind , ImplItemKind , intravisit} ;
12
- use rustc_infer:: infer:: outlives:: env:: OutlivesEnvironment ;
13
12
use rustc_infer:: infer:: { self , InferCtxt , TyCtxtInferExt } ;
14
13
use rustc_infer:: traits:: util;
15
14
use rustc_middle:: ty:: error:: { ExpectedFound , TypeError } ;
@@ -24,7 +23,6 @@ use rustc_span::Span;
24
23
use rustc_trait_selection:: error_reporting:: InferCtxtErrorExt ;
25
24
use rustc_trait_selection:: infer:: InferCtxtExt ;
26
25
use rustc_trait_selection:: regions:: InferCtxtRegionExt ;
27
- use rustc_trait_selection:: traits:: outlives_bounds:: InferCtxtExt as _;
28
26
use rustc_trait_selection:: traits:: {
29
27
self , FulfillmentError , ObligationCause , ObligationCauseCode , ObligationCtxt ,
30
28
} ;
@@ -416,11 +414,7 @@ fn compare_method_predicate_entailment<'tcx>(
416
414
417
415
// Finally, resolve all regions. This catches wily misuses of
418
416
// lifetime parameters.
419
- let outlives_env = OutlivesEnvironment :: with_bounds (
420
- param_env,
421
- infcx. implied_bounds_tys ( param_env, impl_m_def_id, & wf_tys) ,
422
- ) ;
423
- let errors = infcx. resolve_regions ( & outlives_env) ;
417
+ let errors = infcx. resolve_regions ( impl_m_def_id, param_env, wf_tys) ;
424
418
if !errors. is_empty ( ) {
425
419
return Err ( infcx
426
420
. tainted_by_errors ( )
@@ -725,11 +719,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
725
719
726
720
// Finally, resolve all regions. This catches wily misuses of
727
721
// lifetime parameters.
728
- let outlives_env = OutlivesEnvironment :: with_bounds (
729
- param_env,
730
- infcx. implied_bounds_tys ( param_env, impl_m_def_id, & wf_tys) ,
731
- ) ;
732
- ocx. resolve_regions_and_report_errors ( impl_m_def_id, & outlives_env) ?;
722
+ ocx. resolve_regions_and_report_errors ( impl_m_def_id, param_env, wf_tys) ?;
733
723
734
724
let mut remapped_types = DefIdMap :: default ( ) ;
735
725
for ( def_id, ( ty, args) ) in collected_types {
@@ -1883,8 +1873,7 @@ fn compare_const_predicate_entailment<'tcx>(
1883
1873
return Err ( infcx. err_ctxt ( ) . report_fulfillment_errors ( errors) ) ;
1884
1874
}
1885
1875
1886
- let outlives_env = OutlivesEnvironment :: new ( param_env) ;
1887
- ocx. resolve_regions_and_report_errors ( impl_ct_def_id, & outlives_env)
1876
+ ocx. resolve_regions_and_report_errors ( impl_ct_def_id, param_env, [ ] )
1888
1877
}
1889
1878
1890
1879
#[ instrument( level = "debug" , skip( tcx) ) ]
@@ -2017,8 +2006,7 @@ fn compare_type_predicate_entailment<'tcx>(
2017
2006
2018
2007
// Finally, resolve all regions. This catches wily misuses of
2019
2008
// lifetime parameters.
2020
- let outlives_env = OutlivesEnvironment :: new ( param_env) ;
2021
- ocx. resolve_regions_and_report_errors ( impl_ty_def_id, & outlives_env)
2009
+ ocx. resolve_regions_and_report_errors ( impl_ty_def_id, param_env, [ ] )
2022
2010
}
2023
2011
2024
2012
/// Validate that `ProjectionCandidate`s created for this associated type will
@@ -2147,9 +2135,7 @@ pub(super) fn check_type_bounds<'tcx>(
2147
2135
2148
2136
// Finally, resolve all regions. This catches wily misuses of
2149
2137
// lifetime parameters.
2150
- let implied_bounds = infcx. implied_bounds_tys ( param_env, impl_ty_def_id, & assumed_wf_types) ;
2151
- let outlives_env = OutlivesEnvironment :: with_bounds ( param_env, implied_bounds) ;
2152
- ocx. resolve_regions_and_report_errors ( impl_ty_def_id, & outlives_env)
2138
+ ocx. resolve_regions_and_report_errors ( impl_ty_def_id, param_env, assumed_wf_types)
2153
2139
}
2154
2140
2155
2141
struct ReplaceTy < ' tcx > {
0 commit comments