@@ -92,7 +92,7 @@ fn trait_ref_impl_id<'tcx>(
9292 param_env : ParamEnv < ' tcx > ,
9393 trait_ref : rustc_ty:: TraitRef < ' tcx > ,
9494) -> Option < ( DefId , rustc_middle:: ty:: GenericArgsRef < ' tcx > ) > {
95- let trait_ref = tcx. erase_regions ( trait_ref) ;
95+ let trait_ref = tcx. erase_and_anonymize_regions ( trait_ref) ;
9696 let obligation = Obligation :: new ( tcx, ObligationCause :: dummy ( ) , param_env, trait_ref) ;
9797 let impl_source = selcx. select ( & obligation) . ok ( ) ??;
9898 let impl_source = selcx. infcx . resolve_vars_if_possible ( impl_source) ;
@@ -455,7 +455,6 @@ impl<'sess, 'tcx> MirLoweringCtxt<'_, 'sess, 'tcx> {
455455 rustc_mir:: Rvalue :: RawPtr ( kind, place) => {
456456 Ok ( Rvalue :: RawPtr ( * kind, lower_place ( self . tcx , place) ?) )
457457 }
458- rustc_mir:: Rvalue :: Len ( place) => Ok ( Rvalue :: Len ( lower_place ( self . tcx , place) ?) ) ,
459458 rustc_mir:: Rvalue :: Cast ( kind, op, ty) => {
460459 let kind = self . lower_cast_kind ( * kind) . ok_or_else ( || {
461460 UnsupportedReason :: new ( format ! ( "unsupported cast `{kind:?}`" ) )
@@ -897,7 +896,7 @@ impl<'tcx> Lower<'tcx> for rustc_ty::Ty<'tcx> {
897896 let args = args. lower ( tcx) ?;
898897 Ok ( Ty :: mk_generator_witness ( * did, args) )
899898 }
900- rustc_ty:: Dynamic ( predicates, region, rustc_ty :: DynKind :: Dyn ) => {
899+ rustc_ty:: Dynamic ( predicates, region) => {
901900 let region = region. lower ( tcx) ?;
902901
903902 let exi_preds = List :: from_vec (
@@ -1020,19 +1019,22 @@ impl<'tcx> Lower<'tcx> for rustc_middle::ty::Region<'tcx> {
10201019 type R = Result < Region , UnsupportedReason > ;
10211020
10221021 fn lower ( self , _tcx : TyCtxt < ' tcx > ) -> Self :: R {
1023- use rustc_middle:: ty:: RegionKind ;
1022+ use rustc_middle:: ty;
10241023 match self . kind ( ) {
1025- RegionKind :: ReVar ( rvid) => Ok ( Region :: ReVar ( rvid) ) ,
1026- RegionKind :: ReBound ( debruijn, bregion) => {
1024+ ty :: ReVar ( rvid) => Ok ( Region :: ReVar ( rvid) ) ,
1025+ ty :: ReBound ( ty :: BoundVarIndexKind :: Bound ( debruijn) , bregion) => {
10271026 Ok ( Region :: ReBound (
10281027 debruijn,
10291028 Ok ( BoundRegion { kind : bregion. kind , var : bregion. var } ) ?,
10301029 ) )
10311030 }
1032- RegionKind :: ReEarlyParam ( bregion) => Ok ( Region :: ReEarlyParam ( bregion) ) ,
1033- RegionKind :: ReStatic => Ok ( Region :: ReStatic ) ,
1034- RegionKind :: ReErased => Ok ( Region :: ReErased ) ,
1035- RegionKind :: ReLateParam ( _) | RegionKind :: RePlaceholder ( _) | RegionKind :: ReError ( _) => {
1031+ ty:: ReEarlyParam ( bregion) => Ok ( Region :: ReEarlyParam ( bregion) ) ,
1032+ ty:: ReStatic => Ok ( Region :: ReStatic ) ,
1033+ ty:: ReErased => Ok ( Region :: ReErased ) ,
1034+ ty:: ReBound ( ty:: BoundVarIndexKind :: Canonical , _)
1035+ | ty:: ReLateParam ( _)
1036+ | ty:: RePlaceholder ( _)
1037+ | ty:: ReError ( _) => {
10361038 Err ( UnsupportedReason :: new ( format ! ( "unsupported region `{self:?}`" ) ) )
10371039 }
10381040 }
0 commit comments