@@ -9,7 +9,6 @@ use rustc_errors::{Applicability, ErrorGuaranteed, pluralize, struct_span_code_e
99use rustc_hir:: def:: { DefKind , Res } ;
1010use rustc_hir:: intravisit:: VisitorExt ;
1111use rustc_hir:: { self as hir, AmbigArg , GenericParamKind , ImplItemKind , intravisit} ;
12- use rustc_infer:: infer:: outlives:: env:: OutlivesEnvironment ;
1312use rustc_infer:: infer:: { self , InferCtxt , TyCtxtInferExt } ;
1413use rustc_infer:: traits:: util;
1514use rustc_middle:: ty:: error:: { ExpectedFound , TypeError } ;
@@ -24,7 +23,6 @@ use rustc_span::Span;
2423use rustc_trait_selection:: error_reporting:: InferCtxtErrorExt ;
2524use rustc_trait_selection:: infer:: InferCtxtExt ;
2625use rustc_trait_selection:: regions:: InferCtxtRegionExt ;
27- use rustc_trait_selection:: traits:: outlives_bounds:: InferCtxtExt as _;
2826use rustc_trait_selection:: traits:: {
2927 self , FulfillmentError , ObligationCause , ObligationCauseCode , ObligationCtxt ,
3028} ;
@@ -416,11 +414,7 @@ fn compare_method_predicate_entailment<'tcx>(
416414
417415 // Finally, resolve all regions. This catches wily misuses of
418416 // 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) ;
424418 if !errors. is_empty ( ) {
425419 return Err ( infcx
426420 . tainted_by_errors ( )
@@ -725,11 +719,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
725719
726720 // Finally, resolve all regions. This catches wily misuses of
727721 // 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) ?;
733723
734724 let mut remapped_types = DefIdMap :: default ( ) ;
735725 for ( def_id, ( ty, args) ) in collected_types {
@@ -1883,8 +1873,7 @@ fn compare_const_predicate_entailment<'tcx>(
18831873 return Err ( infcx. err_ctxt ( ) . report_fulfillment_errors ( errors) ) ;
18841874 }
18851875
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, [ ] )
18881877}
18891878
18901879#[ instrument( level = "debug" , skip( tcx) ) ]
@@ -2017,8 +2006,7 @@ fn compare_type_predicate_entailment<'tcx>(
20172006
20182007 // Finally, resolve all regions. This catches wily misuses of
20192008 // 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, [ ] )
20222010}
20232011
20242012/// Validate that `ProjectionCandidate`s created for this associated type will
@@ -2147,9 +2135,7 @@ pub(super) fn check_type_bounds<'tcx>(
21472135
21482136 // Finally, resolve all regions. This catches wily misuses of
21492137 // 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)
21532139}
21542140
21552141struct ReplaceTy < ' tcx > {
0 commit comments