@@ -449,6 +449,13 @@ impl<'tcx> Stable<'tcx> for ty::TyKind<'tcx> {
449449 dyn_kind. stable ( tables, cx) ,
450450 ) )
451451 }
452+ ty:: Dynamic ( existential_predicates, region) => TyKind :: RigidTy ( RigidTy :: Dynamic (
453+ existential_predicates
454+ . iter ( )
455+ . map ( |existential_predicate| existential_predicate. stable ( tables, cx) )
456+ . collect ( ) ,
457+ region. stable ( tables, cx) ,
458+ ) ) ,
452459 ty:: Closure ( def_id, generic_args) => TyKind :: RigidTy ( RigidTy :: Closure (
453460 tables. closure_def ( * def_id) ,
454461 generic_args. stable ( tables, cx) ,
@@ -467,6 +474,10 @@ impl<'tcx> Stable<'tcx> for ty::TyKind<'tcx> {
467474 }
468475 ty:: Param ( param_ty) => TyKind :: Param ( param_ty. stable ( tables, cx) ) ,
469476 ty:: Bound ( debruijn_idx, bound_ty) => {
477+ ty:: Bound ( ty:: BoundVarIndexKind :: Canonical , _) => {
478+ unreachable ! ( )
479+ }
480+ ty:: Bound ( ty:: BoundVarIndexKind :: Bound ( debruijn_idx) , bound_ty) => {
470481 TyKind :: Bound ( debruijn_idx. as_usize ( ) , bound_ty. stable ( tables, cx) )
471482 }
472483 ty:: CoroutineWitness ( def_id, args) => TyKind :: RigidTy ( RigidTy :: CoroutineWitness (
@@ -495,6 +506,7 @@ impl<'tcx> Stable<'tcx> for ty::Pattern<'tcx> {
495506 end : Some ( end. stable ( tables, cx) ) ,
496507 include_end : true ,
497508 } ,
509+ ty:: PatternKind :: NotNull => todo ! ( ) ,
498510 ty:: PatternKind :: Or ( _) => todo ! ( ) ,
499511 }
500512 }
@@ -663,6 +675,13 @@ impl<'tcx> Stable<'tcx> for rustc_middle::ty::GenericParamDefKind {
663675 }
664676 ty:: GenericParamDefKind :: Const { has_default, synthetic : _ } => {
665677 GenericParamDefKind :: Const { has_default : * has_default }
678+ match * self {
679+ ty:: GenericParamDefKind :: Lifetime => GenericParamDefKind :: Lifetime ,
680+ ty:: GenericParamDefKind :: Type { has_default, synthetic } => {
681+ GenericParamDefKind :: Type { has_default, synthetic }
682+ }
683+ ty:: GenericParamDefKind :: Const { has_default } => {
684+ GenericParamDefKind :: Const { has_default }
666685 }
667686 }
668687 }
@@ -921,6 +940,7 @@ impl<'tcx> Stable<'tcx> for ty::RegionKind<'tcx> {
921940 name : early_reg. name . to_string ( ) ,
922941 } ) ,
923942 ty:: ReBound ( db_index, bound_reg) => RegionKind :: ReBound (
943+ ty:: ReBound ( ty:: BoundVarIndexKind :: Bound ( db_index) , bound_reg) => RegionKind :: ReBound (
924944 db_index. as_u32 ( ) ,
925945 BoundRegion {
926946 var : bound_reg. var . as_u32 ( ) ,
@@ -1084,6 +1104,21 @@ impl<'tcx> Stable<'tcx> for ty::AssocItemContainer {
10841104 match self {
10851105 ty:: AssocItemContainer :: Trait => AssocItemContainer :: Trait ,
10861106 ty:: AssocItemContainer :: Impl => AssocItemContainer :: Impl ,
1107+ impl < ' tcx > Stable < ' tcx > for ty:: AssocContainer {
1108+ type T = crate :: ty:: AssocContainer ;
1109+
1110+ fn stable(
1111+ & self ,
1112+ tables: & mut Tables < ' _ , BridgeTys > ,
1113+ _: & CompilerCtxt < ' _ , BridgeTys > ,
1114+ ) -> Self :: T {
1115+ use crate:: ty:: AssocContainer ;
1116+ match self {
1117+ ty:: AssocContainer :: Trait => AssocContainer :: Trait ,
1118+ ty:: AssocContainer :: InherentImpl => AssocContainer :: InherentImpl ,
1119+ ty:: AssocContainer :: TraitImpl ( trait_item_id) => {
1120+ AssocContainer :: TraitImpl ( tables. assoc_def( trait_item_id. unwrap( ) ) )
1121+ }
10871122 }
10881123 }
10891124}
0 commit comments