@@ -10,8 +10,9 @@ use rustc_span::Symbol;
1010use stable_mir:: mir:: alloc:: AllocId ;
1111use stable_mir:: mir:: mono:: { Instance , MonoItem , StaticDef } ;
1212use stable_mir:: ty:: {
13- AdtDef , Binder , BoundRegionKind , BoundTyKind , BoundVariableKind , ClosureKind , Const , FloatTy ,
14- GenericArgKind , GenericArgs , IntTy , Region , RigidTy , TraitRef , Ty , UintTy ,
13+ AdtDef , Binder , BoundRegionKind , BoundTyKind , BoundVariableKind , ClosureKind , Const ,
14+ ExistentialTraitRef , FloatTy , GenericArgKind , GenericArgs , IntTy , Region , RigidTy , TraitRef ,
15+ Ty , UintTy ,
1516} ;
1617use stable_mir:: { CrateItem , DefId } ;
1718
@@ -229,6 +230,17 @@ impl<'tcx> RustcInternal<'tcx> for BoundVariableKind {
229230 }
230231}
231232
233+ impl < ' tcx > RustcInternal < ' tcx > for ExistentialTraitRef {
234+ type T = rustc_ty:: ExistentialTraitRef < ' tcx > ;
235+
236+ fn internal ( & self , tables : & mut Tables < ' tcx > ) -> Self :: T {
237+ rustc_ty:: ExistentialTraitRef {
238+ def_id : self . def_id . 0 . internal ( tables) ,
239+ args : self . generic_args . internal ( tables) ,
240+ }
241+ }
242+ }
243+
232244impl < ' tcx > RustcInternal < ' tcx > for TraitRef {
233245 type T = rustc_ty:: TraitRef < ' tcx > ;
234246
@@ -277,3 +289,13 @@ where
277289 ( * self ) . internal ( tables)
278290 }
279291}
292+ impl < ' tcx , T > RustcInternal < ' tcx > for Option < T >
293+ where
294+ T : RustcInternal < ' tcx > ,
295+ {
296+ type T = Option < T :: T > ;
297+
298+ fn internal ( & self , tables : & mut Tables < ' tcx > ) -> Self :: T {
299+ self . as_ref ( ) . map ( |inner| inner. internal ( tables) )
300+ }
301+ }
0 commit comments