File tree 2 files changed +18
-1
lines changed
2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -826,7 +826,9 @@ impl<'tcx> Stable<'tcx> for Ty<'tcx> {
826
826
TyKind :: Alias ( alias_kind. stable ( tables) , alias_ty. stable ( tables) )
827
827
}
828
828
ty:: Param ( param_ty) => TyKind :: Param ( param_ty. stable ( tables) ) ,
829
- ty:: Bound ( _, _) => todo ! ( ) ,
829
+ ty:: Bound ( debruijn_idx, bound_ty) => {
830
+ TyKind :: Bound ( debruijn_idx. as_usize ( ) , bound_ty. stable ( tables) )
831
+ }
830
832
ty:: Placeholder ( ..)
831
833
| ty:: GeneratorWitness ( _)
832
834
| ty:: GeneratorWitnessMIR ( _, _)
@@ -845,3 +847,11 @@ impl<'tcx> Stable<'tcx> for rustc_middle::ty::ParamTy {
845
847
ParamTy { index : self . index , name : self . name . to_string ( ) }
846
848
}
847
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
+ }
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ pub enum TyKind {
19
19
RigidTy ( RigidTy ) ,
20
20
Alias ( AliasKind , AliasTy ) ,
21
21
Param ( ParamTy ) ,
22
+ Bound ( usize , BoundTy ) ,
22
23
}
23
24
24
25
#[ derive( Clone , Debug ) ]
@@ -235,3 +236,9 @@ pub struct ParamTy {
235
236
pub index : u32 ,
236
237
pub name : String ,
237
238
}
239
+
240
+ #[ derive( Clone , Debug ) ]
241
+ pub struct BoundTy {
242
+ pub var : usize ,
243
+ pub kind : BoundTyKind ,
244
+ }
You can’t perform that action at this time.
0 commit comments