@@ -714,13 +714,6 @@ pub enum IntVarValue {
714
714
#[ derive( Clone , Copy , PartialEq , Eq ) ]
715
715
pub struct FloatVarValue ( pub ast:: FloatTy ) ;
716
716
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
-
724
717
impl ty:: EarlyBoundRegion {
725
718
pub fn to_bound_region ( & self ) -> ty:: BoundRegion {
726
719
ty:: BoundRegion :: BrNamed ( self . def_id , self . name )
@@ -730,7 +723,11 @@ impl ty::EarlyBoundRegion {
730
723
#[ derive( Clone , Debug , RustcEncodable , RustcDecodable ) ]
731
724
pub enum GenericParamDefKind {
732
725
Lifetime ,
733
- Type ( TypeParamDef ) ,
726
+ Type {
727
+ has_default : bool ,
728
+ object_lifetime_default : ObjectLifetimeDefault ,
729
+ synthetic : Option < hir:: SyntheticTyParamKind > ,
730
+ }
734
731
}
735
732
736
733
#[ derive( Clone , RustcEncodable , RustcDecodable ) ]
@@ -811,7 +808,7 @@ impl<'a, 'gcx, 'tcx> Generics {
811
808
for param in & self . params {
812
809
match param. kind {
813
810
GenericParamDefKind :: Lifetime => own_counts. lifetimes += 1 ,
814
- GenericParamDefKind :: Type ( _ ) => own_counts. types += 1 ,
811
+ GenericParamDefKind :: Type { .. } => own_counts. types += 1 ,
815
812
} ;
816
813
}
817
814
@@ -821,7 +818,7 @@ impl<'a, 'gcx, 'tcx> Generics {
821
818
pub fn requires_monomorphization ( & self , tcx : TyCtxt < ' a , ' gcx , ' tcx > ) -> bool {
822
819
for param in & self . params {
823
820
match param. kind {
824
- GenericParamDefKind :: Type ( _ ) => return true ,
821
+ GenericParamDefKind :: Type { .. } => return true ,
825
822
GenericParamDefKind :: Lifetime => { }
826
823
}
827
824
}
@@ -850,15 +847,15 @@ impl<'a, 'gcx, 'tcx> Generics {
850
847
}
851
848
}
852
849
853
- /// Returns the `TypeParamDef ` associated with this `ParamTy`.
850
+ /// Returns the `GenericParamDef ` associated with this `ParamTy`.
854
851
pub fn type_param ( & ' tcx self ,
855
852
param : & ParamTy ,
856
853
tcx : TyCtxt < ' a , ' gcx , ' tcx > )
857
854
-> & ' tcx GenericParamDef {
858
855
if let Some ( index) = param. idx . checked_sub ( self . parent_count as u32 ) {
859
856
let param = & self . params [ index as usize ] ;
860
857
match param. kind {
861
- ty:: GenericParamDefKind :: Type ( _ ) => param,
858
+ ty:: GenericParamDefKind :: Type { .. } => param,
862
859
_ => bug ! ( "expected type parameter, but found another generic parameter" )
863
860
}
864
861
} else {
0 commit comments