@@ -124,7 +124,7 @@ impl Method {
124
124
}
125
125
}
126
126
127
- #[ deriving( Clone , PartialEq , Eq , Hash ) ]
127
+ #[ deriving( Clone , PartialEq , Eq , Hash , Show ) ]
128
128
pub struct mt {
129
129
pub ty : t ,
130
130
pub mutbl : ast:: Mutability ,
@@ -138,7 +138,7 @@ pub enum TraitStore {
138
138
RegionTraitStore ( Region , ast:: Mutability ) ,
139
139
}
140
140
141
- #[ deriving( Clone ) ]
141
+ #[ deriving( Clone , Show ) ]
142
142
pub struct field_ty {
143
143
pub name : Name ,
144
144
pub id : DefId ,
@@ -394,6 +394,7 @@ pub enum tbox_flag {
394
394
395
395
pub type t_box = & ' static t_box_ ;
396
396
397
+ #[ deriving( Show ) ]
397
398
pub struct t_box_ {
398
399
pub sty : sty ,
399
400
pub id : uint ,
@@ -436,14 +437,14 @@ pub fn type_needs_infer(t: t) -> bool {
436
437
}
437
438
pub fn type_id ( t : t ) -> uint { get ( t) . id }
438
439
439
- #[ deriving( Clone , PartialEq , Eq , Hash ) ]
440
+ #[ deriving( Clone , PartialEq , Eq , Hash , Show ) ]
440
441
pub struct BareFnTy {
441
442
pub fn_style : ast:: FnStyle ,
442
443
pub abi : abi:: Abi ,
443
444
pub sig : FnSig ,
444
445
}
445
446
446
- #[ deriving( Clone , PartialEq , Eq , Hash ) ]
447
+ #[ deriving( Clone , PartialEq , Eq , Hash , Show ) ]
447
448
pub struct ClosureTy {
448
449
pub fn_style : ast:: FnStyle ,
449
450
pub onceness : ast:: Onceness ,
@@ -472,7 +473,7 @@ pub struct FnSig {
472
473
pub variadic : bool
473
474
}
474
475
475
- #[ deriving( Clone , PartialEq , Eq , Hash ) ]
476
+ #[ deriving( Clone , PartialEq , Eq , Hash , Show ) ]
476
477
pub struct ParamTy {
477
478
pub space : subst:: ParamSpace ,
478
479
pub idx : uint ,
@@ -712,7 +713,7 @@ mod primitives {
712
713
713
714
// NB: If you change this, you'll probably want to change the corresponding
714
715
// AST structure in libsyntax/ast.rs as well.
715
- #[ deriving( Clone , PartialEq , Eq , Hash ) ]
716
+ #[ deriving( Clone , PartialEq , Eq , Hash , Show ) ]
716
717
pub enum sty {
717
718
ty_nil,
718
719
ty_bot,
@@ -741,14 +742,14 @@ pub enum sty {
741
742
// on non-useful type error messages)
742
743
}
743
744
744
- #[ deriving( Clone , PartialEq , Eq , Hash ) ]
745
+ #[ deriving( Clone , PartialEq , Eq , Hash , Show ) ]
745
746
pub struct TyTrait {
746
747
pub def_id : DefId ,
747
748
pub substs : Substs ,
748
749
pub bounds : BuiltinBounds
749
750
}
750
751
751
- #[ deriving( PartialEq , Eq , Hash ) ]
752
+ #[ deriving( PartialEq , Eq , Hash , Show ) ]
752
753
pub struct TraitRef {
753
754
pub def_id : DefId ,
754
755
pub substs : Substs ,
@@ -808,7 +809,7 @@ pub enum type_err {
808
809
terr_variadic_mismatch( expected_found < bool > )
809
810
}
810
811
811
- #[ deriving( PartialEq , Eq , Hash ) ]
812
+ #[ deriving( PartialEq , Eq , Hash , Show ) ]
812
813
pub struct ParamBounds {
813
814
pub builtin_bounds : BuiltinBounds ,
814
815
pub trait_bounds : Vec < Rc < TraitRef > >
@@ -948,7 +949,7 @@ impl fmt::Show for IntVarValue {
948
949
}
949
950
}
950
951
951
- #[ deriving( Clone ) ]
952
+ #[ deriving( Clone , Show ) ]
952
953
pub struct TypeParameterDef {
953
954
pub ident : ast:: Ident ,
954
955
pub def_id : ast:: DefId ,
@@ -958,7 +959,7 @@ pub struct TypeParameterDef {
958
959
pub default : Option < ty:: t >
959
960
}
960
961
961
- #[ deriving( Encodable , Decodable , Clone ) ]
962
+ #[ deriving( Encodable , Decodable , Clone , Show ) ]
962
963
pub struct RegionParameterDef {
963
964
pub name : ast:: Name ,
964
965
pub def_id : ast:: DefId ,
@@ -968,7 +969,7 @@ pub struct RegionParameterDef {
968
969
969
970
/// Information about the type/lifetime parameters associated with an
970
971
/// item or method. Analogous to ast::Generics.
971
- #[ deriving( Clone ) ]
972
+ #[ deriving( Clone , Show ) ]
972
973
pub struct Generics {
973
974
pub types : VecPerParamSpace < TypeParameterDef > ,
974
975
pub regions : VecPerParamSpace < RegionParameterDef > ,
@@ -983,6 +984,10 @@ impl Generics {
983
984
pub fn has_type_params ( & self , space : subst:: ParamSpace ) -> bool {
984
985
!self . types . is_empty_in ( space)
985
986
}
987
+
988
+ pub fn has_region_params ( & self , space : subst:: ParamSpace ) -> bool {
989
+ !self . regions . is_empty_in ( space)
990
+ }
986
991
}
987
992
988
993
/// When type checking, we use the `ParameterEnvironment` to track
@@ -1014,7 +1019,7 @@ pub struct ParameterEnvironment {
1014
1019
/// - `generics`: the set of type parameters and their bounds
1015
1020
/// - `ty`: the base types, which may reference the parameters defined
1016
1021
/// in `generics`
1017
- #[ deriving( Clone ) ]
1022
+ #[ deriving( Clone , Show ) ]
1018
1023
pub struct Polytype {
1019
1024
pub generics : Generics ,
1020
1025
pub ty : t
0 commit comments