@@ -124,7 +124,7 @@ impl Method {
124124 }
125125}
126126
127- #[ deriving( Clone , PartialEq , Eq , Hash ) ]
127+ #[ deriving( Clone , PartialEq , Eq , Hash , Show ) ]
128128pub struct mt {
129129 pub ty : t ,
130130 pub mutbl : ast:: Mutability ,
@@ -138,7 +138,7 @@ pub enum TraitStore {
138138 RegionTraitStore ( Region , ast:: Mutability ) ,
139139}
140140
141- #[ deriving( Clone ) ]
141+ #[ deriving( Clone , Show ) ]
142142pub struct field_ty {
143143 pub name : Name ,
144144 pub id : DefId ,
@@ -394,6 +394,7 @@ pub enum tbox_flag {
394394
395395pub type t_box = & ' static t_box_ ;
396396
397+ #[ deriving( Show ) ]
397398pub struct t_box_ {
398399 pub sty : sty ,
399400 pub id : uint ,
@@ -436,14 +437,14 @@ pub fn type_needs_infer(t: t) -> bool {
436437}
437438pub fn type_id ( t : t ) -> uint { get ( t) . id }
438439
439- #[ deriving( Clone , PartialEq , Eq , Hash ) ]
440+ #[ deriving( Clone , PartialEq , Eq , Hash , Show ) ]
440441pub struct BareFnTy {
441442 pub fn_style : ast:: FnStyle ,
442443 pub abi : abi:: Abi ,
443444 pub sig : FnSig ,
444445}
445446
446- #[ deriving( Clone , PartialEq , Eq , Hash ) ]
447+ #[ deriving( Clone , PartialEq , Eq , Hash , Show ) ]
447448pub struct ClosureTy {
448449 pub fn_style : ast:: FnStyle ,
449450 pub onceness : ast:: Onceness ,
@@ -472,7 +473,7 @@ pub struct FnSig {
472473 pub variadic : bool
473474}
474475
475- #[ deriving( Clone , PartialEq , Eq , Hash ) ]
476+ #[ deriving( Clone , PartialEq , Eq , Hash , Show ) ]
476477pub struct ParamTy {
477478 pub space : subst:: ParamSpace ,
478479 pub idx : uint ,
@@ -712,7 +713,7 @@ mod primitives {
712713
713714// NB: If you change this, you'll probably want to change the corresponding
714715// AST structure in libsyntax/ast.rs as well.
715- #[ deriving( Clone , PartialEq , Eq , Hash ) ]
716+ #[ deriving( Clone , PartialEq , Eq , Hash , Show ) ]
716717pub enum sty {
717718 ty_nil,
718719 ty_bot,
@@ -741,14 +742,14 @@ pub enum sty {
741742 // on non-useful type error messages)
742743}
743744
744- #[ deriving( Clone , PartialEq , Eq , Hash ) ]
745+ #[ deriving( Clone , PartialEq , Eq , Hash , Show ) ]
745746pub struct TyTrait {
746747 pub def_id : DefId ,
747748 pub substs : Substs ,
748749 pub bounds : BuiltinBounds
749750}
750751
751- #[ deriving( PartialEq , Eq , Hash ) ]
752+ #[ deriving( PartialEq , Eq , Hash , Show ) ]
752753pub struct TraitRef {
753754 pub def_id : DefId ,
754755 pub substs : Substs ,
@@ -808,7 +809,7 @@ pub enum type_err {
808809 terr_variadic_mismatch( expected_found < bool > )
809810}
810811
811- #[ deriving( PartialEq , Eq , Hash ) ]
812+ #[ deriving( PartialEq , Eq , Hash , Show ) ]
812813pub struct ParamBounds {
813814 pub builtin_bounds : BuiltinBounds ,
814815 pub trait_bounds : Vec < Rc < TraitRef > >
@@ -948,7 +949,7 @@ impl fmt::Show for IntVarValue {
948949 }
949950}
950951
951- #[ deriving( Clone ) ]
952+ #[ deriving( Clone , Show ) ]
952953pub struct TypeParameterDef {
953954 pub ident : ast:: Ident ,
954955 pub def_id : ast:: DefId ,
@@ -958,7 +959,7 @@ pub struct TypeParameterDef {
958959 pub default : Option < ty:: t >
959960}
960961
961- #[ deriving( Encodable , Decodable , Clone ) ]
962+ #[ deriving( Encodable , Decodable , Clone , Show ) ]
962963pub struct RegionParameterDef {
963964 pub name : ast:: Name ,
964965 pub def_id : ast:: DefId ,
@@ -968,7 +969,7 @@ pub struct RegionParameterDef {
968969
969970/// Information about the type/lifetime parameters associated with an
970971/// item or method. Analogous to ast::Generics.
971- #[ deriving( Clone ) ]
972+ #[ deriving( Clone , Show ) ]
972973pub struct Generics {
973974 pub types : VecPerParamSpace < TypeParameterDef > ,
974975 pub regions : VecPerParamSpace < RegionParameterDef > ,
@@ -983,6 +984,10 @@ impl Generics {
983984 pub fn has_type_params ( & self , space : subst:: ParamSpace ) -> bool {
984985 !self . types . is_empty_in ( space)
985986 }
987+
988+ pub fn has_region_params ( & self , space : subst:: ParamSpace ) -> bool {
989+ !self . regions . is_empty_in ( space)
990+ }
986991}
987992
988993/// When type checking, we use the `ParameterEnvironment` to track
@@ -1014,7 +1019,7 @@ pub struct ParameterEnvironment {
10141019/// - `generics`: the set of type parameters and their bounds
10151020/// - `ty`: the base types, which may reference the parameters defined
10161021/// in `generics`
1017- #[ deriving( Clone ) ]
1022+ #[ deriving( Clone , Show ) ]
10181023pub struct Polytype {
10191024 pub generics : Generics ,
10201025 pub ty : t
0 commit comments