@@ -189,7 +189,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
189
189
/// Returns `true` if a closure is inferred to be an `FnMut` closure.
190
190
fn is_closure_fn_mut ( & self , fr : RegionVid ) -> bool {
191
191
if let Some ( ty:: ReLateParam ( late_param) ) = self . to_error_region ( fr) . as_deref ( )
192
- && let ty:: BoundRegionKind :: ClosureEnv = late_param. bound_region
192
+ && let ty:: LateParamRegionKind :: ClosureEnv = late_param. kind
193
193
&& let DefiningTy :: Closure ( _, args) = self . regioncx . universal_regions ( ) . defining_ty
194
194
{
195
195
return args. as_closure ( ) . kind ( ) == ty:: ClosureKind :: FnMut ;
@@ -848,7 +848,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
848
848
return ;
849
849
} ;
850
850
851
- let fn_returns = self . infcx . tcx . return_type_impl_or_dyn_traits ( suitable_region. def_id ) ;
851
+ let fn_returns = self . infcx . tcx . return_type_impl_or_dyn_traits ( suitable_region. scope ) ;
852
852
853
853
let param = if let Some ( param) =
854
854
find_param_with_region ( self . infcx . tcx , self . mir_def_id ( ) , f, outlived_f)
@@ -875,15 +875,15 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
875
875
Some ( arg) ,
876
876
captures,
877
877
Some ( ( param. param_ty_span , param. param_ty . to_string ( ) ) ) ,
878
- Some ( suitable_region. def_id ) ,
878
+ Some ( suitable_region. scope ) ,
879
879
) ;
880
880
return ;
881
881
}
882
882
883
883
let Some ( ( alias_tys, alias_span, lt_addition_span) ) = self
884
884
. infcx
885
885
. tcx
886
- . return_type_impl_or_dyn_traits_with_type_alias ( suitable_region. def_id )
886
+ . return_type_impl_or_dyn_traits_with_type_alias ( suitable_region. scope )
887
887
else {
888
888
return ;
889
889
} ;
@@ -1018,18 +1018,20 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
1018
1018
return ;
1019
1019
} ;
1020
1020
1021
- let Some ( ( ty_sub, _) ) =
1022
- self . infcx . tcx . is_suitable_region ( self . mir_def_id ( ) , sub) . and_then ( |anon_reg| {
1023
- find_anon_type ( self . infcx . tcx , self . mir_def_id ( ) , sub, & anon_reg. bound_region )
1024
- } )
1021
+ let Some ( ( ty_sub, _) ) = self
1022
+ . infcx
1023
+ . tcx
1024
+ . is_suitable_region ( self . mir_def_id ( ) , sub)
1025
+ . and_then ( |_| find_anon_type ( self . infcx . tcx , self . mir_def_id ( ) , sub) )
1025
1026
else {
1026
1027
return ;
1027
1028
} ;
1028
1029
1029
- let Some ( ( ty_sup, _) ) =
1030
- self . infcx . tcx . is_suitable_region ( self . mir_def_id ( ) , sup) . and_then ( |anon_reg| {
1031
- find_anon_type ( self . infcx . tcx , self . mir_def_id ( ) , sup, & anon_reg. bound_region )
1032
- } )
1030
+ let Some ( ( ty_sup, _) ) = self
1031
+ . infcx
1032
+ . tcx
1033
+ . is_suitable_region ( self . mir_def_id ( ) , sup)
1034
+ . and_then ( |_| find_anon_type ( self . infcx . tcx , self . mir_def_id ( ) , sup) )
1033
1035
else {
1034
1036
return ;
1035
1037
} ;
0 commit comments