@@ -3,6 +3,7 @@ use rustc_errors::ErrorGuaranteed;
33use rustc_hir:: def_id:: LocalDefId ;
44use rustc_infer:: infer:: { InferCtxt , NllRegionVariableOrigin , TyCtxtInferExt as _} ;
55use rustc_macros:: extension;
6+ use rustc_middle:: ty:: fold:: fold_regions;
67use rustc_middle:: ty:: visit:: TypeVisitableExt ;
78use rustc_middle:: ty:: {
89 self , GenericArgKind , GenericArgs , OpaqueHiddenType , OpaqueTypeKey , Ty , TyCtxt , TypeFoldable ,
@@ -117,7 +118,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
117118 } ) ;
118119 debug ! ( ?opaque_type_key, ?arg_regions) ;
119120
120- let concrete_type = infcx. tcx . fold_regions ( concrete_type, |region, _| {
121+ let concrete_type = fold_regions ( infcx. tcx , concrete_type, |region, _| {
121122 arg_regions
122123 . iter ( )
123124 . find ( |& & ( arg_vid, _) | self . eval_equal ( region. as_var ( ) , arg_vid) )
@@ -204,7 +205,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
204205 where
205206 T : TypeFoldable < TyCtxt < ' tcx > > ,
206207 {
207- tcx . fold_regions ( ty, |region, _| match * region {
208+ fold_regions ( tcx , ty, |region, _| match * region {
208209 ty:: ReVar ( vid) => {
209210 let scc = self . constraint_sccs . scc ( vid) ;
210211
@@ -442,7 +443,7 @@ impl<'tcx> LazyOpaqueTyEnv<'tcx> {
442443 let outlives_env = OutlivesEnvironment :: with_bounds ( param_env, implied_bounds) ;
443444
444445 let mut seen = vec ! [ tcx. lifetimes. re_static] ;
445- let canonical_args = tcx . fold_regions ( args, |r1, _| {
446+ let canonical_args = fold_regions ( tcx , args, |r1, _| {
446447 if r1. is_error ( ) {
447448 r1
448449 } else if let Some ( & r2) = seen. iter ( ) . find ( |& & r2| {
0 commit comments