@@ -714,13 +714,6 @@ pub enum IntVarValue {
714714#[ derive( Clone , Copy , PartialEq , Eq ) ]
715715pub struct FloatVarValue ( pub ast:: FloatTy ) ;
716716
717- #[ derive( Copy , Clone , Debug , RustcEncodable , RustcDecodable ) ]
718- pub struct TypeParamDef {
719- pub has_default : bool ,
720- pub object_lifetime_default : ObjectLifetimeDefault ,
721- pub synthetic : Option < hir:: SyntheticTyParamKind > ,
722- }
723-
724717impl ty:: EarlyBoundRegion {
725718 pub fn to_bound_region ( & self ) -> ty:: BoundRegion {
726719 ty:: BoundRegion :: BrNamed ( self . def_id , self . name )
@@ -730,7 +723,11 @@ impl ty::EarlyBoundRegion {
730723#[ derive( Clone , Debug , RustcEncodable , RustcDecodable ) ]
731724pub enum GenericParamDefKind {
732725 Lifetime ,
733- Type ( TypeParamDef ) ,
726+ Type {
727+ has_default : bool ,
728+ object_lifetime_default : ObjectLifetimeDefault ,
729+ synthetic : Option < hir:: SyntheticTyParamKind > ,
730+ }
734731}
735732
736733#[ derive( Clone , RustcEncodable , RustcDecodable ) ]
@@ -811,7 +808,7 @@ impl<'a, 'gcx, 'tcx> Generics {
811808 for param in & self . params {
812809 match param. kind {
813810 GenericParamDefKind :: Lifetime => own_counts. lifetimes += 1 ,
814- GenericParamDefKind :: Type ( _ ) => own_counts. types += 1 ,
811+ GenericParamDefKind :: Type { .. } => own_counts. types += 1 ,
815812 } ;
816813 }
817814
@@ -821,7 +818,7 @@ impl<'a, 'gcx, 'tcx> Generics {
821818 pub fn requires_monomorphization ( & self , tcx : TyCtxt < ' a , ' gcx , ' tcx > ) -> bool {
822819 for param in & self . params {
823820 match param. kind {
824- GenericParamDefKind :: Type ( _ ) => return true ,
821+ GenericParamDefKind :: Type { .. } => return true ,
825822 GenericParamDefKind :: Lifetime => { }
826823 }
827824 }
@@ -850,15 +847,15 @@ impl<'a, 'gcx, 'tcx> Generics {
850847 }
851848 }
852849
853- /// Returns the `TypeParamDef ` associated with this `ParamTy`.
850+ /// Returns the `GenericParamDef ` associated with this `ParamTy`.
854851 pub fn type_param ( & ' tcx self ,
855852 param : & ParamTy ,
856853 tcx : TyCtxt < ' a , ' gcx , ' tcx > )
857854 -> & ' tcx GenericParamDef {
858855 if let Some ( index) = param. idx . checked_sub ( self . parent_count as u32 ) {
859856 let param = & self . params [ index as usize ] ;
860857 match param. kind {
861- ty:: GenericParamDefKind :: Type ( _ ) => param,
858+ ty:: GenericParamDefKind :: Type { .. } => param,
862859 _ => bug ! ( "expected type parameter, but found another generic parameter" )
863860 }
864861 } else {
0 commit comments