@@ -848,7 +848,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
848848 return ;
849849 } ;
850850
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 ) ;
852852
853853 let param = if let Some ( param) =
854854 find_param_with_region ( self . infcx . tcx , self . mir_def_id ( ) , f, outlived_f)
@@ -875,15 +875,15 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
875875 Some ( arg) ,
876876 captures,
877877 Some ( ( param. param_ty_span , param. param_ty . to_string ( ) ) ) ,
878- Some ( suitable_region. def_id ) ,
878+ Some ( suitable_region. scope ) ,
879879 ) ;
880880 return ;
881881 }
882882
883883 let Some ( ( alias_tys, alias_span, lt_addition_span) ) = self
884884 . infcx
885885 . 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 )
887887 else {
888888 return ;
889889 } ;
@@ -1018,18 +1018,20 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
10181018 return ;
10191019 } ;
10201020
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) )
10251026 else {
10261027 return ;
10271028 } ;
10281029
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) )
10331035 else {
10341036 return ;
10351037 } ;
0 commit comments