@@ -76,6 +76,7 @@ pub struct method {
7676 def_id : ast:: def_id
7777}
7878
79+ #[ deriving( Eq ) ]
7980pub struct mt {
8081 ty : t ,
8182 mutbl : ast:: mutability ,
@@ -161,22 +162,9 @@ pub type opt_region_variance = Option<region_variance>;
161162
162163#[ auto_encode]
163164#[ auto_decode]
165+ #[ deriving( Eq ) ]
164166pub enum region_variance { rv_covariant, rv_invariant, rv_contravariant }
165167
166- impl cmp:: Eq for region_variance {
167- fn eq ( & self , other : & region_variance ) -> bool {
168- match ( ( * self ) , ( * other) ) {
169- ( rv_covariant, rv_covariant) => true ,
170- ( rv_invariant, rv_invariant) => true ,
171- ( rv_contravariant, rv_contravariant) => true ,
172- ( rv_covariant, _) => false ,
173- ( rv_invariant, _) => false ,
174- ( rv_contravariant, _) => false
175- }
176- }
177- fn ne ( & self , other : & region_variance ) -> bool { !( * self ) . eq ( other) }
178- }
179-
180168#[ auto_encode]
181169#[ auto_decode]
182170pub enum AutoAdjustment {
@@ -417,6 +405,7 @@ impl to_bytes::IterBytes for param_ty {
417405/// Representation of regions:
418406#[ auto_encode]
419407#[ auto_decode]
408+ #[ deriving( Eq ) ]
420409pub enum Region {
421410 /// Bound regions are found (primarily) in function types. They indicate
422411 /// region parameters that have yet to be replaced with actual regions
@@ -446,6 +435,7 @@ pub enum Region {
446435
447436#[ auto_encode]
448437#[ auto_decode]
438+ #[ deriving( Eq ) ]
449439pub enum bound_region {
450440 /// The self region for structs, impls (&T in a type defn or &'self T)
451441 br_self,
@@ -585,6 +575,7 @@ pub enum type_err {
585575 terr_float_mismatch( expected_found < ast:: float_ty > )
586576}
587577
578+ #[ deriving( Eq ) ]
588579pub enum param_bound {
589580 bound_copy,
590581 bound_durable,
@@ -4367,127 +4358,6 @@ pub fn get_impl_id(tcx: ctxt, trait_id: def_id, self_ty: t) -> def_id {
43674358 }
43684359}
43694360
4370- impl cmp:: Eq for mt {
4371- fn eq ( & self , other : & mt ) -> bool {
4372- ( * self ) . ty == ( * other) . ty && ( * self ) . mutbl == ( * other) . mutbl
4373- }
4374- fn ne ( & self , other : & mt ) -> bool { !( * self ) . eq ( other) }
4375- }
4376-
4377- impl cmp:: Eq for Region {
4378- fn eq ( & self , other : & Region ) -> bool {
4379- match ( * self ) {
4380- re_bound( e0a) => {
4381- match ( * other) {
4382- re_bound( e0b) => e0a == e0b,
4383- _ => false
4384- }
4385- }
4386- re_free( e0a, e1a) => {
4387- match ( * other) {
4388- re_free( e0b, e1b) => e0a == e0b && e1a == e1b,
4389- _ => false
4390- }
4391- }
4392- re_scope( e0a) => {
4393- match ( * other) {
4394- re_scope( e0b) => e0a == e0b,
4395- _ => false
4396- }
4397- }
4398- re_static => {
4399- match ( * other) {
4400- re_static => true ,
4401- _ => false
4402- }
4403- }
4404- re_infer( e0a) => {
4405- match ( * other) {
4406- re_infer( e0b) => e0a == e0b,
4407- _ => false
4408- }
4409- }
4410- }
4411- }
4412- fn ne ( & self , other : & Region ) -> bool { !( * self ) . eq ( other) }
4413- }
4414-
4415- impl cmp:: Eq for bound_region {
4416- fn eq ( & self , other : & bound_region ) -> bool {
4417- match ( * self ) {
4418- br_self => {
4419- match ( * other) {
4420- br_self => true ,
4421- _ => false
4422- }
4423- }
4424- br_anon( e0a) => {
4425- match ( * other) {
4426- br_anon( e0b) => e0a == e0b,
4427- _ => false
4428- }
4429- }
4430- br_named( e0a) => {
4431- match ( * other) {
4432- br_named( e0b) => e0a == e0b,
4433- _ => false
4434- }
4435- }
4436- br_cap_avoid( e0a, e1a) => {
4437- match ( * other) {
4438- br_cap_avoid( e0b, e1b) => e0a == e0b && e1a == e1b,
4439- _ => false
4440- }
4441- }
4442- br_fresh( e0a) => {
4443- match ( * other) {
4444- br_fresh( e0b) => e0a == e0b,
4445- _ => false
4446- }
4447- }
4448- }
4449- }
4450- fn ne ( & self , other : & bound_region ) -> bool { !( * self ) . eq ( other) }
4451- }
4452-
4453- impl cmp:: Eq for param_bound {
4454- fn eq ( & self , other : & param_bound ) -> bool {
4455- match ( * self ) {
4456- bound_copy => {
4457- match ( * other) {
4458- bound_copy => true ,
4459- _ => false
4460- }
4461- }
4462- bound_durable => {
4463- match ( * other) {
4464- bound_durable => true ,
4465- _ => false
4466- }
4467- }
4468- bound_owned => {
4469- match ( * other) {
4470- bound_owned => true ,
4471- _ => false
4472- }
4473- }
4474- bound_const => {
4475- match ( * other) {
4476- bound_const => true ,
4477- _ => false
4478- }
4479- }
4480- bound_trait( e0a) => {
4481- match ( * other) {
4482- bound_trait( e0b) => e0a == e0b,
4483- _ => false
4484- }
4485- }
4486- }
4487- }
4488- fn ne ( & self , other : & param_bound ) -> bool { !self . eq ( other) }
4489- }
4490-
44914361// Local Variables:
44924362// mode: rust
44934363// fill-column: 78;
0 commit comments