@@ -237,6 +237,27 @@ impl<'tcx> Stable<'tcx> for mir::CastKind {
237
237
}
238
238
}
239
239
240
+ impl < ' tcx > Stable < ' tcx > for ty:: AliasKind {
241
+ type T = stable_mir:: ty:: AliasKind ;
242
+ fn stable ( & self , _: & mut Tables < ' tcx > ) -> Self :: T {
243
+ use ty:: AliasKind :: * ;
244
+ match self {
245
+ Projection => stable_mir:: ty:: AliasKind :: Projection ,
246
+ Inherent => stable_mir:: ty:: AliasKind :: Inherent ,
247
+ Opaque => stable_mir:: ty:: AliasKind :: Opaque ,
248
+ Weak => stable_mir:: ty:: AliasKind :: Weak ,
249
+ }
250
+ }
251
+ }
252
+
253
+ impl < ' tcx > Stable < ' tcx > for ty:: AliasTy < ' tcx > {
254
+ type T = stable_mir:: ty:: AliasTy ;
255
+ fn stable ( & self , tables : & mut Tables < ' tcx > ) -> Self :: T {
256
+ let ty:: AliasTy { args, def_id, .. } = self ;
257
+ stable_mir:: ty:: AliasTy { def_id : tables. alias_def ( * def_id) , args : args. stable ( tables) }
258
+ }
259
+ }
260
+
240
261
impl < ' tcx > Stable < ' tcx > for ty:: adjustment:: PointerCoercion {
241
262
type T = stable_mir:: mir:: PointerCoercion ;
242
263
fn stable ( & self , tables : & mut Tables < ' tcx > ) -> Self :: T {
@@ -667,7 +688,9 @@ impl<'tcx> Stable<'tcx> for Ty<'tcx> {
667
688
ty:: Tuple ( fields) => TyKind :: RigidTy ( RigidTy :: Tuple (
668
689
fields. iter ( ) . map ( |ty| tables. intern_ty ( ty) ) . collect ( ) ,
669
690
) ) ,
670
- ty:: Alias ( _, _) => todo ! ( ) ,
691
+ ty:: Alias ( alias_kind, alias_ty) => {
692
+ TyKind :: Alias ( alias_kind. stable ( tables) , alias_ty. stable ( tables) )
693
+ }
671
694
ty:: Param ( _) => todo ! ( ) ,
672
695
ty:: Bound ( _, _) => todo ! ( ) ,
673
696
ty:: Placeholder ( ..)
0 commit comments