@@ -12,10 +12,11 @@ use stable_mir::mir::alloc::AllocId;
1212use stable_mir:: mir:: mono:: { Instance , MonoItem , StaticDef } ;
1313use stable_mir:: mir:: { BinOp , Mutability , Place , ProjectionElem , RawPtrKind , Safety , UnOp } ;
1414use stable_mir:: ty:: {
15- Abi , AdtDef , Binder , BoundRegionKind , BoundTyKind , BoundVariableKind , ClosureKind , DynKind ,
16- ExistentialPredicate , ExistentialProjection , ExistentialTraitRef , FloatTy , FnSig ,
17- GenericArgKind , GenericArgs , IndexedVal , IntTy , MirConst , Movability , Pattern , Region , RigidTy ,
18- Span , TermKind , TraitRef , Ty , TyConst , UintTy , VariantDef , VariantIdx ,
15+ Abi , AdtDef , AssocItem , AssocItemContainer , AssocKind , Binder , BoundRegionKind , BoundTyKind ,
16+ BoundVariableKind , ClosureKind , DynKind , ExistentialPredicate , ExistentialProjection ,
17+ ExistentialTraitRef , FloatTy , FnSig , GenericArgKind , GenericArgs , ImplTraitInTraitData ,
18+ IndexedVal , IntTy , MirConst , Movability , Pattern , Region , RigidTy , Span , TermKind , TraitRef ,
19+ Ty , TyConst , UintTy , VariantDef , VariantIdx ,
1920} ;
2021use stable_mir:: { CrateItem , CrateNum , DefId } ;
2122
@@ -570,6 +571,65 @@ impl RustcInternal for ProjectionElem {
570571 }
571572}
572573
574+ impl RustcInternal for AssocItem {
575+ type T < ' tcx > = rustc_middle:: ty:: AssocItem ;
576+
577+ fn internal < ' tcx > ( & self , tables : & mut Tables < ' _ > , tcx : TyCtxt < ' tcx > ) -> Self :: T < ' tcx > {
578+ rustc_middle:: ty:: AssocItem {
579+ def_id : self . def_id . 0 . internal ( tables, tcx) ,
580+ name : Symbol :: intern ( & self . name ) ,
581+ kind : self . kind . internal ( tables, tcx) ,
582+ container : self . container . internal ( tables, tcx) ,
583+ trait_item_def_id : self . trait_item_def_id . map ( |did| did. 0 . internal ( tables, tcx) ) ,
584+ fn_has_self_parameter : self . fn_has_self_parameter ,
585+ opt_rpitit_info : self . opt_rpitit_info . map ( |did| did. internal ( tables, tcx) ) ,
586+ }
587+ }
588+ }
589+
590+ impl RustcInternal for AssocItemContainer {
591+ type T < ' tcx > = rustc_middle:: ty:: AssocItemContainer ;
592+
593+ fn internal < ' tcx > ( & self , _tables : & mut Tables < ' _ > , _tcx : TyCtxt < ' tcx > ) -> Self :: T < ' tcx > {
594+ match self {
595+ AssocItemContainer :: Trait => rustc_middle:: ty:: AssocItemContainer :: Trait ,
596+ AssocItemContainer :: Impl => rustc_middle:: ty:: AssocItemContainer :: Impl ,
597+ }
598+ }
599+ }
600+
601+ impl RustcInternal for AssocKind {
602+ type T < ' tcx > = rustc_middle:: ty:: AssocKind ;
603+
604+ fn internal < ' tcx > ( & self , _tables : & mut Tables < ' _ > , _tcx : TyCtxt < ' tcx > ) -> Self :: T < ' tcx > {
605+ match self {
606+ AssocKind :: Const => rustc_middle:: ty:: AssocKind :: Const ,
607+ AssocKind :: Fn => rustc_middle:: ty:: AssocKind :: Fn ,
608+ AssocKind :: Type => rustc_middle:: ty:: AssocKind :: Type ,
609+ }
610+ }
611+ }
612+
613+ impl RustcInternal for ImplTraitInTraitData {
614+ type T < ' tcx > = rustc_middle:: ty:: ImplTraitInTraitData ;
615+
616+ fn internal < ' tcx > ( & self , tables : & mut Tables < ' _ > , tcx : TyCtxt < ' tcx > ) -> Self :: T < ' tcx > {
617+ match self {
618+ ImplTraitInTraitData :: Trait { fn_def_id, opaque_def_id } => {
619+ rustc_middle:: ty:: ImplTraitInTraitData :: Trait {
620+ fn_def_id : fn_def_id. 0 . internal ( tables, tcx) ,
621+ opaque_def_id : opaque_def_id. 0 . internal ( tables, tcx) ,
622+ }
623+ }
624+ ImplTraitInTraitData :: Impl { fn_def_id } => {
625+ rustc_middle:: ty:: ImplTraitInTraitData :: Impl {
626+ fn_def_id : fn_def_id. 0 . internal ( tables, tcx) ,
627+ }
628+ }
629+ }
630+ }
631+ }
632+
573633impl RustcInternal for BinOp {
574634 type T < ' tcx > = rustc_middle:: mir:: BinOp ;
575635
0 commit comments