File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -825,7 +825,7 @@ 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 ! ( ) ,
828+ ty:: Param ( param_ty ) => TyKind :: Param ( param_ty . stable ( tables ) ) ,
829829 ty:: Bound ( _, _) => todo ! ( ) ,
830830 ty:: Placeholder ( ..)
831831 | ty:: GeneratorWitness ( _)
@@ -837,3 +837,11 @@ impl<'tcx> Stable<'tcx> for Ty<'tcx> {
837837 }
838838 }
839839}
840+
841+ impl < ' tcx > Stable < ' tcx > for rustc_middle:: ty:: ParamTy {
842+ type T = stable_mir:: ty:: ParamTy ;
843+ fn stable ( & self , _: & mut Tables < ' tcx > ) -> Self :: T {
844+ use stable_mir:: ty:: ParamTy ;
845+ ParamTy { index : self . index , name : self . name . to_string ( ) }
846+ }
847+ }
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ type Span = Opaque;
1818pub enum TyKind {
1919 RigidTy ( RigidTy ) ,
2020 Alias ( AliasKind , AliasTy ) ,
21+ Param ( ParamTy ) ,
2122}
2223
2324#[ derive( Clone , Debug ) ]
@@ -228,3 +229,9 @@ pub struct ExistentialProjection {
228229 pub generic_args : GenericArgs ,
229230 pub term : TermKind ,
230231}
232+
233+ #[ derive( Clone , Debug ) ]
234+ pub struct ParamTy {
235+ pub index : u32 ,
236+ pub name : String ,
237+ }
You can’t perform that action at this time.
0 commit comments