@@ -3,6 +3,7 @@ use rustc_errors::ErrorGuaranteed;
3
3
use rustc_hir:: def_id:: LocalDefId ;
4
4
use rustc_infer:: infer:: { InferCtxt , NllRegionVariableOrigin , TyCtxtInferExt as _} ;
5
5
use rustc_macros:: extension;
6
+ use rustc_middle:: ty:: fold:: fold_regions;
6
7
use rustc_middle:: ty:: visit:: TypeVisitableExt ;
7
8
use rustc_middle:: ty:: {
8
9
self , GenericArgKind , GenericArgs , OpaqueHiddenType , OpaqueTypeKey , Ty , TyCtxt , TypeFoldable ,
@@ -117,7 +118,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
117
118
} ) ;
118
119
debug ! ( ?opaque_type_key, ?arg_regions) ;
119
120
120
- let concrete_type = infcx. tcx . fold_regions ( concrete_type, |region, _| {
121
+ let concrete_type = fold_regions ( infcx. tcx , concrete_type, |region, _| {
121
122
arg_regions
122
123
. iter ( )
123
124
. find ( |& & ( arg_vid, _) | self . eval_equal ( region. as_var ( ) , arg_vid) )
@@ -204,7 +205,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
204
205
where
205
206
T : TypeFoldable < TyCtxt < ' tcx > > ,
206
207
{
207
- tcx . fold_regions ( ty, |region, _| match * region {
208
+ fold_regions ( tcx , ty, |region, _| match * region {
208
209
ty:: ReVar ( vid) => {
209
210
let scc = self . constraint_sccs . scc ( vid) ;
210
211
@@ -442,7 +443,7 @@ impl<'tcx> LazyOpaqueTyEnv<'tcx> {
442
443
let outlives_env = OutlivesEnvironment :: with_bounds ( param_env, implied_bounds) ;
443
444
444
445
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, _| {
446
447
if r1. is_error ( ) {
447
448
r1
448
449
} else if let Some ( & r2) = seen. iter ( ) . find ( |& & r2| {
0 commit comments