@@ -76,6 +76,7 @@ pub struct method {
76
76
def_id : ast:: def_id
77
77
}
78
78
79
+ #[ deriving( Eq ) ]
79
80
pub struct mt {
80
81
ty : t ,
81
82
mutbl : ast:: mutability ,
@@ -161,22 +162,9 @@ pub type opt_region_variance = Option<region_variance>;
161
162
162
163
#[ auto_encode]
163
164
#[ auto_decode]
165
+ #[ deriving( Eq ) ]
164
166
pub enum region_variance { rv_covariant, rv_invariant, rv_contravariant }
165
167
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
-
180
168
#[ auto_encode]
181
169
#[ auto_decode]
182
170
pub enum AutoAdjustment {
@@ -417,6 +405,7 @@ impl to_bytes::IterBytes for param_ty {
417
405
/// Representation of regions:
418
406
#[ auto_encode]
419
407
#[ auto_decode]
408
+ #[ deriving( Eq ) ]
420
409
pub enum Region {
421
410
/// Bound regions are found (primarily) in function types. They indicate
422
411
/// region parameters that have yet to be replaced with actual regions
@@ -446,6 +435,7 @@ pub enum Region {
446
435
447
436
#[ auto_encode]
448
437
#[ auto_decode]
438
+ #[ deriving( Eq ) ]
449
439
pub enum bound_region {
450
440
/// The self region for structs, impls (&T in a type defn or &'self T)
451
441
br_self,
@@ -585,6 +575,7 @@ pub enum type_err {
585
575
terr_float_mismatch( expected_found < ast:: float_ty > )
586
576
}
587
577
578
+ #[ deriving( Eq ) ]
588
579
pub enum param_bound {
589
580
bound_copy,
590
581
bound_durable,
@@ -4367,127 +4358,6 @@ pub fn get_impl_id(tcx: ctxt, trait_id: def_id, self_ty: t) -> def_id {
4367
4358
}
4368
4359
}
4369
4360
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
-
4491
4361
// Local Variables:
4492
4362
// mode: rust
4493
4363
// fill-column: 78;
0 commit comments