@@ -825,8 +825,10 @@ impl<'tcx> Stable<'tcx> for Ty<'tcx> {
825825 ty:: Alias ( alias_kind, alias_ty) => {
826826 TyKind :: Alias ( alias_kind. stable ( tables) , alias_ty. stable ( tables) )
827827 }
828- ty:: Param ( _) => todo ! ( ) ,
829- ty:: Bound ( _, _) => todo ! ( ) ,
828+ ty:: Param ( param_ty) => TyKind :: Param ( param_ty. stable ( tables) ) ,
829+ ty:: Bound ( debruijn_idx, bound_ty) => {
830+ TyKind :: Bound ( debruijn_idx. as_usize ( ) , bound_ty. stable ( tables) )
831+ }
830832 ty:: Placeholder ( ..)
831833 | ty:: GeneratorWitness ( _)
832834 | ty:: GeneratorWitnessMIR ( _, _)
@@ -837,3 +839,19 @@ impl<'tcx> Stable<'tcx> for Ty<'tcx> {
837839 }
838840 }
839841}
842+
843+ impl < ' tcx > Stable < ' tcx > for rustc_middle:: ty:: ParamTy {
844+ type T = stable_mir:: ty:: ParamTy ;
845+ fn stable ( & self , _: & mut Tables < ' tcx > ) -> Self :: T {
846+ use stable_mir:: ty:: ParamTy ;
847+ ParamTy { index : self . index , name : self . name . to_string ( ) }
848+ }
849+ }
850+
851+ impl < ' tcx > Stable < ' tcx > for rustc_middle:: ty:: BoundTy {
852+ type T = stable_mir:: ty:: BoundTy ;
853+ fn stable ( & self , tables : & mut Tables < ' tcx > ) -> Self :: T {
854+ use stable_mir:: ty:: BoundTy ;
855+ BoundTy { var : self . var . as_usize ( ) , kind : self . kind . stable ( tables) }
856+ }
857+ }
0 commit comments