diff options
Diffstat (limited to 'src/rustc')
| -rw-r--r-- | src/rustc/back/link.rs | 9 | ||||
| -rw-r--r-- | src/rustc/driver/driver.rs | 9 | ||||
| -rw-r--r-- | src/rustc/driver/rustc.rs | 9 | ||||
| -rw-r--r-- | src/rustc/driver/session.rs | 27 | ||||
| -rw-r--r-- | src/rustc/lib/llvm.rs | 42 | ||||
| -rw-r--r-- | src/rustc/metadata/decoder.rs | 9 | ||||
| -rw-r--r-- | src/rustc/middle/borrowck.rs | 67 | ||||
| -rw-r--r-- | src/rustc/middle/borrowck/check_loans.rs | 31 | ||||
| -rw-r--r-- | src/rustc/middle/check_alt.rs | 19 | ||||
| -rw-r--r-- | src/rustc/middle/const_eval.rs | 17 | ||||
| -rw-r--r-- | src/rustc/middle/lint.rs | 18 | ||||
| -rw-r--r-- | src/rustc/middle/liveness.rs | 48 | ||||
| -rw-r--r-- | src/rustc/middle/mem_categorization.rs | 190 | ||||
| -rw-r--r-- | src/rustc/middle/region.rs | 9 | ||||
| -rw-r--r-- | src/rustc/middle/resolve.rs | 54 | ||||
| -rw-r--r-- | src/rustc/middle/trans/alt.rs | 9 | ||||
| -rw-r--r-- | src/rustc/middle/trans/common.rs | 53 | ||||
| -rw-r--r-- | src/rustc/middle/trans/datum.rs | 24 | ||||
| -rw-r--r-- | src/rustc/middle/trans/expr.rs | 34 | ||||
| -rw-r--r-- | src/rustc/middle/trans/foreign.rs | 9 | ||||
| -rw-r--r-- | src/rustc/middle/trans/shape.rs | 18 | ||||
| -rw-r--r-- | src/rustc/middle/ty.rs | 530 | ||||
| -rw-r--r-- | src/rustc/middle/typeck/infer/region_var_bindings.rs | 49 |
23 files changed, 0 insertions, 1284 deletions
diff --git a/src/rustc/back/link.rs b/src/rustc/back/link.rs index 22d7451c6ae..fb3d749673c 100644 --- a/src/rustc/back/link.rs +++ b/src/rustc/back/link.rs @@ -26,15 +26,6 @@ enum output_type { output_type_exe, } -#[cfg(stage0)] -impl output_type : cmp::Eq { - pure fn eq(&&other: output_type) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: output_type) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl output_type : cmp::Eq { pure fn eq(other: &output_type) -> bool { (self as uint) == ((*other) as uint) diff --git a/src/rustc/driver/driver.rs b/src/rustc/driver/driver.rs index 6fe6cab58e0..f890fa85eb3 100644 --- a/src/rustc/driver/driver.rs +++ b/src/rustc/driver/driver.rs @@ -138,15 +138,6 @@ enum compile_upto { cu_everything, } -#[cfg(stage0)] -impl compile_upto : cmp::Eq { - pure fn eq(&&other: compile_upto) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: compile_upto) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl compile_upto : cmp::Eq { pure fn eq(other: &compile_upto) -> bool { (self as uint) == ((*other) as uint) diff --git a/src/rustc/driver/rustc.rs b/src/rustc/driver/rustc.rs index 3d055237669..1b4b47f1014 100644 --- a/src/rustc/driver/rustc.rs +++ b/src/rustc/driver/rustc.rs @@ -207,15 +207,6 @@ enum monitor_msg { done, } -#[cfg(stage0)] -impl monitor_msg : cmp::Eq { - pure fn eq(&&other: monitor_msg) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: monitor_msg) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl monitor_msg : cmp::Eq { pure fn eq(other: &monitor_msg) -> bool { (self as uint) == ((*other) as uint) diff --git a/src/rustc/driver/session.rs b/src/rustc/driver/session.rs index 2e8cddf2095..335e1004078 100644 --- a/src/rustc/driver/session.rs +++ b/src/rustc/driver/session.rs @@ -12,15 +12,6 @@ use middle::lint; enum os { os_win32, os_macos, os_linux, os_freebsd, } -#[cfg(stage0)] -impl os : cmp::Eq { - pure fn eq(&&other: os) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: os) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl os : cmp::Eq { pure fn eq(other: &os) -> bool { (self as uint) == ((*other) as uint) @@ -30,15 +21,6 @@ impl os : cmp::Eq { enum arch { arch_x86, arch_x86_64, arch_arm, } -#[cfg(stage0)] -impl arch: cmp::Eq { - pure fn eq(&&other: arch) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: arch) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl arch : cmp::Eq { pure fn eq(other: &arch) -> bool { (self as uint) == ((*other) as uint) @@ -112,15 +94,6 @@ enum OptLevel { Aggressive // -O3 } -#[cfg(stage0)] -impl OptLevel : cmp::Eq { - pure fn eq(&&other: OptLevel) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: OptLevel) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl OptLevel : cmp::Eq { pure fn eq(other: &OptLevel) -> bool { (self as uint) == ((*other) as uint) diff --git a/src/rustc/lib/llvm.rs b/src/rustc/lib/llvm.rs index 60c08dab716..031ce219308 100644 --- a/src/rustc/lib/llvm.rs +++ b/src/rustc/lib/llvm.rs @@ -128,48 +128,6 @@ enum TypeKind { X86_MMX = 15 } -#[cfg(stage0)] -impl TypeKind : cmp::Eq { - pure fn eq(&&other: TypeKind) -> bool { - match (self, other) { - (Void, Void) => true, - (Half, Half) => true, - (Float, Float) => true, - (Double, Double) => true, - (X86_FP80, X86_FP80) => true, - (FP128, FP128) => true, - (PPC_FP128, PPC_FP128) => true, - (Label, Label) => true, - (Integer, Integer) => true, - (Function, Function) => true, - (Struct, Struct) => true, - (Array, Array) => true, - (Pointer, Pointer) => true, - (Vector, Vector) => true, - (Metadata, Metadata) => true, - (X86_MMX, X86_MMX) => true, - (Void, _) => false, - (Half, _) => false, - (Float, _) => false, - (Double, _) => false, - (X86_FP80, _) => false, - (FP128, _) => false, - (PPC_FP128, _) => false, - (Label, _) => false, - (Integer, _) => false, - (Function, _) => false, - (Struct, _) => false, - (Array, _) => false, - (Pointer, _) => false, - (Vector, _) => false, - (Metadata, _) => false, - (X86_MMX, _) => false, - } - } - pure fn ne(&&other: TypeKind) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl TypeKind : cmp::Eq { pure fn eq(other: &TypeKind) -> bool { match (self, (*other)) { diff --git a/src/rustc/metadata/decoder.rs b/src/rustc/metadata/decoder.rs index 181b8c6f104..c631e404472 100644 --- a/src/rustc/metadata/decoder.rs +++ b/src/rustc/metadata/decoder.rs @@ -129,15 +129,6 @@ enum Family { InheritedField // N } -#[cfg(stage0)] -impl Family : cmp::Eq { - pure fn eq(&&other: Family) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: Family) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl Family : cmp::Eq { pure fn eq(other: &Family) -> bool { (self as uint) == ((*other) as uint) diff --git a/src/rustc/middle/borrowck.rs b/src/rustc/middle/borrowck.rs index 67f3c8405a8..4906eb4a0a3 100644 --- a/src/rustc/middle/borrowck.rs +++ b/src/rustc/middle/borrowck.rs @@ -323,53 +323,6 @@ enum bckerr_code { err_out_of_scope(ty::region, ty::region) // superscope, subscope } -#[cfg(stage0)] -impl bckerr_code : cmp::Eq { - pure fn eq(&&other: bckerr_code) -> bool { - match self { - err_mut_uniq => { - match other { - err_mut_uniq => true, - _ => false - } - } - err_mut_variant => { - match other { - err_mut_variant => true, - _ => false - } - } - err_root_not_permitted => { - match other { - err_root_not_permitted => true, - _ => false - } - } - err_mutbl(e0a) => { - match other { - err_mutbl(e0b) => e0a == e0b, - _ => false - } - } - err_out_of_root_scope(e0a, e1a) => { - match other { - err_out_of_root_scope(e0b, e1b) => - e0a == e0b && e1a == e1b, - _ => false - } - } - err_out_of_scope(e0a, e1a) => { - match other { - err_out_of_scope(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - } - } - pure fn ne(&&other: bckerr_code) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl bckerr_code : cmp::Eq { pure fn eq(other: &bckerr_code) -> bool { match self { @@ -419,15 +372,6 @@ impl bckerr_code : cmp::Eq { // that caused it type bckerr = {cmt: cmt, code: bckerr_code}; -#[cfg(stage0)] -impl bckerr : cmp::Eq { - pure fn eq(&&other: bckerr) -> bool { - self.cmt == other.cmt && self.code == other.code - } - pure fn ne(&&other: bckerr) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl bckerr : cmp::Eq { pure fn eq(other: &bckerr) -> bool { self.cmt == (*other).cmt && self.code == (*other).code @@ -461,17 +405,6 @@ fn save_and_restore<T:Copy,U>(&save_and_restore_t: T, f: fn() -> U) -> U { /// Creates and returns a new root_map -#[cfg(stage0)] -impl root_map_key : cmp::Eq { - pure fn eq(&&other: root_map_key) -> bool { - self.id == other.id && self.derefs == other.derefs - } - pure fn ne(&&other: root_map_key) -> bool { - ! (self == other) - } -} -#[cfg(stage1)] -#[cfg(stage2)] impl root_map_key : cmp::Eq { pure fn eq(other: &root_map_key) -> bool { self.id == (*other).id && self.derefs == (*other).derefs diff --git a/src/rustc/middle/borrowck/check_loans.rs b/src/rustc/middle/borrowck/check_loans.rs index 86fbce8cada..c0aaa041d18 100644 --- a/src/rustc/middle/borrowck/check_loans.rs +++ b/src/rustc/middle/borrowck/check_loans.rs @@ -36,28 +36,6 @@ enum purity_cause { pc_cmt(bckerr) } -#[cfg(stage0)] -impl purity_cause : cmp::Eq { - pure fn eq(&&other: purity_cause) -> bool { - match self { - pc_pure_fn => { - match other { - pc_pure_fn => true, - _ => false - } - } - pc_cmt(e0a) => { - match other { - pc_cmt(e0b) => e0a == e0b, - _ => false - } - } - } - } - pure fn ne(&&other: purity_cause) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl purity_cause : cmp::Eq { pure fn eq(other: &purity_cause) -> bool { match self { @@ -100,15 +78,6 @@ enum assignment_type { at_swap } -#[cfg(stage0)] -impl assignment_type : cmp::Eq { - pure fn eq(&&other: assignment_type) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: assignment_type) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl assignment_type : cmp::Eq { pure fn eq(other: &assignment_type) -> bool { (self as uint) == ((*other) as uint) diff --git a/src/rustc/middle/check_alt.rs b/src/rustc/middle/check_alt.rs index a0f8ad4a4d4..0d8d8b8dfe0 100644 --- a/src/rustc/middle/check_alt.rs +++ b/src/rustc/middle/check_alt.rs @@ -124,25 +124,6 @@ enum ctor { range(const_val, const_val), } -#[cfg(stage0)] -impl ctor: cmp::Eq { - pure fn eq(&&other: ctor) -> bool { - match (self, other) { - (single, single) => true, - (variant(did_self), variant(did_other)) => did_self == did_other, - (val(cv_self), val(cv_other)) => cv_self == cv_other, - (range(cv0_self, cv1_self), range(cv0_other, cv1_other)) => { - cv0_self == cv0_other && cv1_self == cv1_other - } - (single, _) | (variant(_), _) | (val(_), _) | (range(*), _) => { - false - } - } - } - pure fn ne(&&other: ctor) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl ctor : cmp::Eq { pure fn eq(other: &ctor) -> bool { match (self, (*other)) { diff --git a/src/rustc/middle/const_eval.rs b/src/rustc/middle/const_eval.rs index b0206d4b95f..463bf502036 100644 --- a/src/rustc/middle/const_eval.rs +++ b/src/rustc/middle/const_eval.rs @@ -189,23 +189,6 @@ enum const_val { const_bool(bool) } -#[cfg(stage0)] -impl const_val: cmp::Eq { - pure fn eq(&&other: const_val) -> bool { - match (self, other) { - (const_float(a), const_float(b)) => a == b, - (const_int(a), const_int(b)) => a == b, - (const_uint(a), const_uint(b)) => a == b, - (const_str(a), const_str(b)) => a == b, - (const_bool(a), const_bool(b)) => a == b, - (const_float(_), _) | (const_int(_), _) | (const_uint(_), _) | - (const_str(_), _) | (const_bool(_), _) => false - } - } - pure fn ne(&&other: const_val) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl const_val : cmp::Eq { pure fn eq(other: &const_val) -> bool { match (self, (*other)) { diff --git a/src/rustc/middle/lint.rs b/src/rustc/middle/lint.rs index 10079338f03..a6778d83b99 100644 --- a/src/rustc/middle/lint.rs +++ b/src/rustc/middle/lint.rs @@ -66,15 +66,6 @@ enum lint { // dead_assignment } -#[cfg(stage0)] -impl lint : cmp::Eq { - pure fn eq(&&other: lint) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: lint) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl lint : cmp::Eq { pure fn eq(other: &lint) -> bool { (self as uint) == ((*other) as uint) @@ -95,15 +86,6 @@ enum level { allow, warn, deny, forbid } -#[cfg(stage0)] -impl level : cmp::Eq { - pure fn eq(&&other: level) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: level) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl level : cmp::Eq { pure fn eq(other: &level) -> bool { (self as uint) == ((*other) as uint) diff --git a/src/rustc/middle/liveness.rs b/src/rustc/middle/liveness.rs index d34c38b9f27..a4c9b5f4b35 100644 --- a/src/rustc/middle/liveness.rs +++ b/src/rustc/middle/liveness.rs @@ -127,25 +127,11 @@ type last_use_map = HashMap<node_id, @DVec<node_id>>; enum Variable = uint; enum LiveNode = uint; -#[cfg(stage0)] -impl Variable : cmp::Eq { - pure fn eq(&&other: Variable) -> bool { *self == *other } - pure fn ne(&&other: Variable) -> bool { *self != *other } -} -#[cfg(stage1)] -#[cfg(stage2)] impl Variable : cmp::Eq { pure fn eq(other: &Variable) -> bool { *self == *(*other) } pure fn ne(other: &Variable) -> bool { *self != *(*other) } } -#[cfg(stage0)] -impl LiveNode : cmp::Eq { - pure fn eq(&&other: LiveNode) -> bool { *self == *other } - pure fn ne(&&other: LiveNode) -> bool { *self != *other } -} -#[cfg(stage1)] -#[cfg(stage2)] impl LiveNode : cmp::Eq { pure fn eq(other: &LiveNode) -> bool { *self == *(*other) } pure fn ne(other: &LiveNode) -> bool { *self != *(*other) } @@ -158,40 +144,6 @@ enum LiveNodeKind { ExitNode } -#[cfg(stage0)] -impl LiveNodeKind : cmp::Eq { - pure fn eq(&&other: LiveNodeKind) -> bool { - match self { - FreeVarNode(e0a) => { - match other { - FreeVarNode(e0b) => e0a == e0b, - _ => false - } - } - ExprNode(e0a) => { - match other { - ExprNode(e0b) => e0a == e0b, - _ => false - } - } - VarDefNode(e0a) => { - match other { - VarDefNode(e0b) => e0a == e0b, - _ => false - } - } - ExitNode => { - match other { - ExitNode => true, - _ => false - } - } - } - } - pure fn ne(&&other: LiveNodeKind) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl LiveNodeKind : cmp::Eq { pure fn eq(other: &LiveNodeKind) -> bool { match self { diff --git a/src/rustc/middle/mem_categorization.rs b/src/rustc/middle/mem_categorization.rs index 077db7f0260..03d453a84f5 100644 --- a/src/rustc/middle/mem_categorization.rs +++ b/src/rustc/middle/mem_categorization.rs @@ -55,71 +55,6 @@ enum categorization { cat_discr(cmt, ast::node_id), // match discriminant (see preserve()) } -#[cfg(stage0)] -impl categorization : cmp::Eq { - pure fn eq(&&other: categorization) -> bool { - match self { - cat_rvalue => { - match other { - cat_rvalue => true, - _ => false - } - } - cat_special(e0a) => { - match other { - cat_special(e0b) => e0a == e0b, - _ => false - } - } - cat_local(e0a) => { - match other { - cat_local(e0b) => e0a == e0b, - _ => false - } - } - cat_binding(e0a) => { - match other { - cat_binding(e0b) => e0a == e0b, - _ => false - } - } - cat_arg(e0a) => { - match other { - cat_arg(e0b) => e0a == e0b, - _ => false - } - } - cat_stack_upvar(e0a) => { - match other { - cat_stack_upvar(e0b) => e0a == e0b, - _ => false - } - } - cat_deref(e0a, e1a, e2a) => { - match other { - cat_deref(e0b, e1b, e2b) => - e0a == e0b && e1a == e1b && e2a == e2b, - _ => false - } - } - cat_comp(e0a, e1a) => { - match other { - cat_comp(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - cat_discr(e0a, e1a) => { - match other { - cat_discr(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - } - } - pure fn ne(&&other: categorization) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl categorization : cmp::Eq { pure fn eq(other: &categorization) -> bool { match self { @@ -191,40 +126,6 @@ enum ptr_kind { unsafe_ptr } -#[cfg(stage0)] -impl ptr_kind : cmp::Eq { - pure fn eq(&&other: ptr_kind) -> bool { - match self { - uniq_ptr => { - match other { - uniq_ptr => true, - _ => false - } - } - gc_ptr => { - match other { - gc_ptr => true, - _ => false - } - } - region_ptr(e0a) => { - match other { - region_ptr(e0b) => e0a == e0b, - _ => false - } - } - unsafe_ptr => { - match other { - unsafe_ptr => true, - _ => false - } - } - } - } - pure fn ne(&&other: ptr_kind) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl ptr_kind : cmp::Eq { pure fn eq(other: &ptr_kind) -> bool { match self { @@ -268,40 +169,6 @@ enum comp_kind { ast::mutability) // mutability of vec content } -#[cfg(stage0)] -impl comp_kind : cmp::Eq { - pure fn eq(&&other: comp_kind) -> bool { - match self { - comp_tuple => { - match other { - comp_tuple => true, - _ => false - } - } - comp_variant(e0a) => { - match other { - comp_variant(e0b) => e0a == e0b, - _ => false - } - } - comp_field(e0a, e1a) => { - match other { - comp_field(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - comp_index(e0a, e1a) => { - match other { - comp_index(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - } - } - pure fn ne(&&other: comp_kind) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl comp_kind : cmp::Eq { pure fn eq(other: &comp_kind) -> bool { match self { @@ -342,15 +209,6 @@ enum special_kind { sk_heap_upvar } -#[cfg(stage0)] -impl special_kind : cmp::Eq { - pure fn eq(&&other: special_kind) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: special_kind) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl special_kind : cmp::Eq { pure fn eq(other: &special_kind) -> bool { (self as uint) == ((*other) as uint) @@ -370,20 +228,6 @@ type cmt_ = {id: ast::node_id, // id of expr/pat producing this value type cmt = @cmt_; -#[cfg(stage0)] -impl cmt_ : cmp::Eq { - pure fn eq(&&other: cmt_) -> bool { - self.id == other.id && - self.span == other.span && - self.cat == other.cat && - self.lp == other.lp && - self.mutbl == other.mutbl && - self.ty == other.ty - } - pure fn ne(&&other: cmt_) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl cmt_ : cmp::Eq { pure fn eq(other: &cmt_) -> bool { self.id == (*other).id && @@ -406,40 +250,6 @@ enum loan_path { lp_comp(@loan_path, comp_kind) } -#[cfg(stage0)] -impl loan_path : cmp::Eq { - pure fn eq(&&other: loan_path) -> bool { - match self { - lp_local(e0a) => { - match other { - lp_local(e0b) => e0a == e0b, - _ => false - } - } - lp_arg(e0a) => { - match other { - lp_arg(e0b) => e0a == e0b, - _ => false - } - } - lp_deref(e0a, e1a) => { - match other { - lp_deref(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - lp_comp(e0a, e1a) => { - match other { - lp_comp(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - } - } - pure fn ne(&&other: loan_path) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl loan_path : cmp::Eq { pure fn eq(other: &loan_path) -> bool { match self { diff --git a/src/rustc/middle/region.rs b/src/rustc/middle/region.rs index ab218a4d49f..cf496ae6683 100644 --- a/src/rustc/middle/region.rs +++ b/src/rustc/middle/region.rs @@ -373,15 +373,6 @@ type region_paramd_items = HashMap<ast::node_id, region_variance>; type region_dep = {ambient_variance: region_variance, id: ast::node_id}; type dep_map = HashMap<ast::node_id, @DVec<region_dep>>; -#[cfg(stage0)] -impl region_dep: cmp::Eq { - pure fn eq(&&other: region_dep) -> bool { - self.ambient_variance == other.ambient_variance && self.id == other.id - } - pure fn ne(&&other: region_dep) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl region_dep : cmp::Eq { pure fn eq(other: ®ion_dep) -> bool { self.ambient_variance == (*other).ambient_variance && diff --git a/src/rustc/middle/resolve.rs b/src/rustc/middle/resolve.rs index 1d6a8d8a630..13095ed5ccd 100644 --- a/src/rustc/middle/resolve.rs +++ b/src/rustc/middle/resolve.rs @@ -106,15 +106,6 @@ enum PatternBindingMode { IrrefutableMode } -#[cfg(stage0)] -impl PatternBindingMode : cmp::Eq { - pure fn eq(&&other: PatternBindingMode) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: PatternBindingMode) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl PatternBindingMode : cmp::Eq { pure fn eq(other: &PatternBindingMode) -> bool { (self as uint) == ((*other) as uint) @@ -156,15 +147,6 @@ enum Mutability { Immutable } -#[cfg(stage0)] -impl Mutability : cmp::Eq { - pure fn eq(&&other: Mutability) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: Mutability) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl Mutability : cmp::Eq { pure fn eq(other: &Mutability) -> bool { (self as uint) == ((*other) as uint) @@ -200,15 +182,6 @@ enum ImportDirectiveNS { AnyNS } -#[cfg(stage0)] -impl ImportDirectiveNS : cmp::Eq { - pure fn eq(&&other: ImportDirectiveNS) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: ImportDirectiveNS) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl ImportDirectiveNS : cmp::Eq { pure fn eq(other: &ImportDirectiveNS) -> bool { (self as uint) == ((*other) as uint) @@ -305,15 +278,6 @@ enum XrayFlag { Xray //< Private items can be accessed. } -#[cfg(stage0)] -impl XrayFlag : cmp::Eq { - pure fn eq(&&other: XrayFlag) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: XrayFlag) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl XrayFlag : cmp::Eq { pure fn eq(other: &XrayFlag) -> bool { (self as uint) == ((*other) as uint) @@ -326,15 +290,6 @@ enum AllowCapturingSelfFlag { DontAllowCapturingSelf, //< The "self" definition cannot be captured. } -#[cfg(stage0)] -impl AllowCapturingSelfFlag : cmp::Eq { - pure fn eq(&&other: AllowCapturingSelfFlag) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: AllowCapturingSelfFlag) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl AllowCapturingSelfFlag : cmp::Eq { pure fn eq(other: &AllowCapturingSelfFlag) -> bool { (self as uint) == ((*other) as uint) @@ -548,15 +503,6 @@ enum Privacy { Public } -#[cfg(stage0)] -impl Privacy : cmp::Eq { - pure fn eq(&&other: Privacy) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: Privacy) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl Privacy : cmp::Eq { pure fn eq(other: &Privacy) -> bool { (self as uint) == ((*other) as uint) diff --git a/src/rustc/middle/trans/alt.rs b/src/rustc/middle/trans/alt.rs index 203074a2c1d..11b694bcb1d 100644 --- a/src/rustc/middle/trans/alt.rs +++ b/src/rustc/middle/trans/alt.rs @@ -675,15 +675,6 @@ fn pick_col(m: &[@Match]) -> uint { enum branch_kind { no_branch, single, switch, compare, } -#[cfg(stage0)] -impl branch_kind : cmp::Eq { - pure fn eq(&&other: branch_kind) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: branch_kind) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl branch_kind : cmp::Eq { pure fn eq(other: &branch_kind) -> bool { (self as uint) == ((*other) as uint) diff --git a/src/rustc/middle/trans/common.rs b/src/rustc/middle/trans/common.rs index fce97516194..a1ca4287f0e 100644 --- a/src/rustc/middle/trans/common.rs +++ b/src/rustc/middle/trans/common.rs @@ -281,28 +281,6 @@ enum cleanup { clean_temp(ValueRef, fn@(block) -> block, cleantype), } -#[cfg(stage0)] -impl cleantype : cmp::Eq { - pure fn eq(&&other: cleantype) -> bool { - match self { - normal_exit_only => { - match other { - normal_exit_only => true, - _ => false - } - } - normal_exit_and_unwind => { - match other { - normal_exit_and_unwind => true, - _ => false - } - } - } - } - pure fn ne(&&other: cleantype) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl cleantype : cmp::Eq { pure fn eq(other: &cleantype) -> bool { match self { @@ -1135,28 +1113,6 @@ type mono_id_ = {def: ast::def_id, params: ~[mono_param_id]}; type mono_id = @mono_id_; -#[cfg(stage0)] -impl mono_param_id: cmp::Eq { - pure fn eq(&&other: mono_param_id) -> bool { - match (self, other) { - (mono_precise(ty_a, ids_a), mono_precise(ty_b, ids_b)) => { - ty_a == ty_b && ids_a == ids_b - } - (mono_any, mono_any) => true, - (mono_repr(size_a, align_a, is_float_a, mode_a), - mono_repr(size_b, align_b, is_float_b, mode_b)) => { - size_a == size_b && align_a == align_b && - is_float_a == is_float_b && mode_a == mode_b - } - (mono_precise(*), _) => false, - (mono_any, _) => false, - (mono_repr(*), _) => false - } - } - pure fn ne(&&other: mono_param_id) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl mono_param_id : cmp::Eq { pure fn eq(other: &mono_param_id) -> bool { match (self, (*other)) { @@ -1177,15 +1133,6 @@ impl mono_param_id : cmp::Eq { pure fn ne(other: &mono_param_id) -> bool { !self.eq(other) } } -#[cfg(stage0)] -impl mono_id_: cmp::Eq { - pure fn eq(&&other: mono_id_) -> bool { - return self.def == other.def && self.params == other.params; - } - pure fn ne(&&other: mono_id_) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl mono_id_ : cmp::Eq { pure fn eq(other: &mono_id_) -> bool { return self.def == (*other).def && self.params == (*other).params; diff --git a/src/rustc/middle/trans/datum.rs b/src/rustc/middle/trans/datum.rs index 730f068cbb2..3f2705a9bcc 100644 --- a/src/rustc/middle/trans/datum.rs +++ b/src/rustc/middle/trans/datum.rs @@ -138,16 +138,6 @@ impl DatumMode { } } -#[cfg(stage0)] -impl DatumMode: cmp::Eq { - pure fn eq(&&other: DatumMode) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: DatumMode) -> bool { !self.eq(other) } -} - -#[cfg(stage1)] -#[cfg(stage2)] impl DatumMode: cmp::Eq { pure fn eq(other: &DatumMode) -> bool { self as uint == (*other as uint) @@ -776,20 +766,6 @@ impl DatumBlock { } } -#[cfg(stage0)] -impl CopyAction : cmp::Eq { - pure fn eq(&&other: CopyAction) -> bool { - match (self, other) { - (INIT, INIT) => true, - (DROP_EXISTING, DROP_EXISTING) => true, - (INIT, _) => false, - (DROP_EXISTING, _) => false, - } - } - pure fn ne(&&other: CopyAction) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl CopyAction : cmp::Eq { pure fn eq(other: &CopyAction) -> bool { match (self, (*other)) { diff --git a/src/rustc/middle/trans/expr.rs b/src/rustc/middle/trans/expr.rs index 54604835dae..0a38e19a26c 100644 --- a/src/rustc/middle/trans/expr.rs +++ b/src/rustc/middle/trans/expr.rs @@ -147,20 +147,6 @@ impl Dest { } } -#[cfg(stage0)] -impl Dest : cmp::Eq { - pure fn eq(&&other: Dest) -> bool { - match (self, other) { - (SaveIn(e0a), SaveIn(e0b)) => e0a == e0b, - (Ignore, Ignore) => true, - (SaveIn(*), _) => false, - (Ignore, _) => false, - } - } - pure fn ne(&&other: Dest) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl Dest : cmp::Eq { pure fn eq(other: &Dest) -> bool { match (self, (*other)) { @@ -1366,26 +1352,6 @@ enum cast_kind { cast_other, } -#[cfg(stage0)] -impl cast_kind : cmp::Eq { - pure fn eq(&&other: cast_kind) -> bool { - match (self, other) { - (cast_pointer, cast_pointer) => true, - (cast_integral, cast_integral) => true, - (cast_float, cast_float) => true, - (cast_enum, cast_enum) => true, - (cast_other, cast_other) => true, - (cast_pointer, _) => false, - (cast_integral, _) => false, - (cast_float, _) => false, - (cast_enum, _) => false, - (cast_other, _) => false, - } - } - pure fn ne(&&other: cast_kind) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl cast_kind : cmp::Eq { pure fn eq(other: &cast_kind) -> bool { match (self, (*other)) { diff --git a/src/rustc/middle/trans/foreign.rs b/src/rustc/middle/trans/foreign.rs index 6f018fcd1b1..e775b3fd746 100644 --- a/src/rustc/middle/trans/foreign.rs +++ b/src/rustc/middle/trans/foreign.rs @@ -40,15 +40,6 @@ enum x86_64_reg_class { memory_class } -#[cfg(stage0)] -impl x86_64_reg_class: cmp::Eq { - pure fn eq(&&other: x86_64_reg_class) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: x86_64_reg_class) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl x86_64_reg_class : cmp::Eq { pure fn eq(other: &x86_64_reg_class) -> bool { (self as uint) == ((*other) as uint) diff --git a/src/rustc/middle/trans/shape.rs b/src/rustc/middle/trans/shape.rs index 34a499c7e13..e09e3d9493d 100644 --- a/src/rustc/middle/trans/shape.rs +++ b/src/rustc/middle/trans/shape.rs @@ -26,24 +26,6 @@ type nominal_id_ = {did: ast::def_id, parent_id: Option<ast::def_id>, tps: ~[ty::t]}; type nominal_id = @nominal_id_; -#[cfg(stage0)] -impl nominal_id_ : core::cmp::Eq { - pure fn eq(&&other: nominal_id_) -> bool { - if self.did != other.did || - self.parent_id != other.parent_id { - false - } else { - do vec::all2(self.tps, other.tps) |m_tp, n_tp| { - ty::type_id(m_tp) == ty::type_id(n_tp) - } - } - } - pure fn ne(&&other: nominal_id_) -> bool { - ! (self == other) - } -} -#[cfg(stage1)] -#[cfg(stage2)] impl nominal_id_ : core::cmp::Eq { pure fn eq(other: &nominal_id_) -> bool { if self.did != other.did || diff --git a/src/rustc/middle/ty.rs b/src/rustc/middle/ty.rs index 4f753f7163c..b063b759845 100644 --- a/src/rustc/middle/ty.rs +++ b/src/rustc/middle/ty.rs @@ -235,19 +235,6 @@ type field_ty = { type creader_cache_key = {cnum: int, pos: uint, len: uint}; type creader_cache = HashMap<creader_cache_key, t>; -#[cfg(stage0)] -impl creader_cache_key : cmp::Eq { - pure fn eq(&&other: creader_cache_key) -> bool { - self.cnum == other.cnum && - self.pos == other.pos && - self.len == other.len - } - pure fn ne(&&other: creader_cache_key) -> bool { - !(self == other) - } -} -#[cfg(stage1)] -#[cfg(stage2)] impl creader_cache_key : cmp::Eq { pure fn eq(other: &creader_cache_key) -> bool { self.cnum == (*other).cnum && @@ -267,15 +254,6 @@ impl creader_cache_key : to_bytes::IterBytes { type intern_key = {sty: sty, o_def_id: Option<ast::def_id>}; -#[cfg(stage0)] -impl intern_key: cmp::Eq { - pure fn eq(&&other: intern_key) -> bool { - self.sty == other.sty && self.o_def_id == other.o_def_id - } - pure fn ne(&&other: intern_key) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl intern_key : cmp::Eq { pure fn eq(other: &intern_key) -> bool { self.sty == (*other).sty && self.o_def_id == (*other).o_def_id @@ -300,22 +278,6 @@ type opt_region_variance = Option<region_variance>; #[auto_serialize] enum region_variance { rv_covariant, rv_invariant, rv_contravariant } -#[cfg(stage0)] -impl region_variance: cmp::Eq { - pure fn eq(&&other: region_variance) -> bool { - match (self, other) { - (rv_covariant, rv_covariant) => true, - (rv_invariant, rv_invariant) => true, - (rv_contravariant, rv_contravariant) => true, - (rv_covariant, _) => false, - (rv_invariant, _) => false, - (rv_contravariant, _) => false - } - } - pure fn ne(&&other: region_variance) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl region_variance : cmp::Eq { pure fn eq(other: ®ion_variance) -> bool { match (self, (*other)) { @@ -448,15 +410,6 @@ impl closure_kind : to_bytes::IterBytes { } } -#[cfg(stage0)] -impl closure_kind : cmp::Eq { - pure fn eq(&&other: closure_kind) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: closure_kind) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl closure_kind : cmp::Eq { pure fn eq(other: &closure_kind) -> bool { (self as uint) == ((*other) as uint) @@ -481,28 +434,6 @@ impl fn_proto : to_bytes::IterBytes { } } -#[cfg(stage0)] -impl fn_proto : cmp::Eq { - pure fn eq(&&other: fn_proto) -> bool { - match self { - proto_bare => { - match other { - proto_bare => true, - _ => false - } - } - proto_vstore(e0a) => { - match other { - proto_vstore(e0b) => e0a == e0b, - _ => false - } - } - } - } - pure fn ne(&&other: fn_proto) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl fn_proto : cmp::Eq { pure fn eq(other: &fn_proto) -> bool { match self { @@ -562,15 +493,6 @@ type FnTy = FnTyBase<FnMeta>; type param_ty = {idx: uint, def_id: def_id}; -#[cfg(stage0)] -impl param_ty: cmp::Eq { - pure fn eq(&&other: param_ty) -> bool { - self.idx == other.idx && self.def_id == other.def_id - } - pure fn ne(&&other: param_ty) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl param_ty : cmp::Eq { pure fn eq(other: ¶m_ty) -> bool { self.idx == (*other).idx && self.def_id == (*other).def_id @@ -1894,16 +1816,6 @@ fn remove_copyable(k: kind) -> kind { k - kind_(KIND_MASK_COPY | KIND_MASK_DEFAULT_MODE) } -#[cfg(stage0)] -impl kind: ops::BitAnd<kind,kind> { - pure fn bitand(other: kind) -> kind { - unsafe { - lower_kind(self, other) - } - } -} -#[cfg(stage1)] -#[cfg(stage2)] impl kind : ops::BitAnd<kind,kind> { pure fn bitand(other: &kind) -> kind { unsafe { @@ -1912,16 +1824,6 @@ impl kind : ops::BitAnd<kind,kind> { } } -#[cfg(stage0)] -impl kind: ops::BitOr<kind,kind> { - pure fn bitor(other: kind) -> kind { - unsafe { - raise_kind(self, other) - } - } -} -#[cfg(stage1)] -#[cfg(stage2)] impl kind : ops::BitOr<kind,kind> { pure fn bitor(other: &kind) -> kind { unsafe { @@ -1930,16 +1832,6 @@ impl kind : ops::BitOr<kind,kind> { } } -#[cfg(stage0)] -impl kind: ops::Sub<kind,kind> { - pure fn sub(other: kind) -> kind { - unsafe { - kind_(*self & !*other) - } - } -} -#[cfg(stage1)] -#[cfg(stage2)] impl kind : ops::Sub<kind,kind> { pure fn sub(other: &kind) -> kind { unsafe { @@ -4040,15 +3932,6 @@ pure fn determine_inherited_purity(parent_purity: ast::purity, } else { child_purity } } -#[cfg(stage0)] -impl mt : cmp::Eq { - pure fn eq(&&other: mt) -> bool { - self.ty == other.ty && self.mutbl == other.mutbl - } - pure fn ne(&&other: mt) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl mt : cmp::Eq { pure fn eq(other: &mt) -> bool { self.ty == (*other).ty && self.mutbl == (*other).mutbl @@ -4056,15 +3939,6 @@ impl mt : cmp::Eq { pure fn ne(other: &mt) -> bool { !self.eq(other) } } -#[cfg(stage0)] -impl arg : cmp::Eq { - pure fn eq(&&other: arg) -> bool { - self.mode == other.mode && self.ty == other.ty - } - pure fn ne(&&other: arg) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl arg : cmp::Eq { pure fn eq(other: &arg) -> bool { self.mode == (*other).mode && self.ty == (*other).ty @@ -4072,15 +3946,6 @@ impl arg : cmp::Eq { pure fn ne(other: &arg) -> bool { !self.eq(other) } } -#[cfg(stage0)] -impl field : cmp::Eq { - pure fn eq(&&other: field) -> bool { - self.ident == other.ident && self.mt == other.mt - } - pure fn ne(&&other: field) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl field : cmp::Eq { pure fn eq(other: &field) -> bool { self.ident == (*other).ident && self.mt == (*other).mt @@ -4088,40 +3953,6 @@ impl field : cmp::Eq { pure fn ne(other: &field) -> bool { !self.eq(other) } } -#[cfg(stage0)] -impl vstore : cmp::Eq { - pure fn eq(&&other: vstore) -> bool { - match self { - vstore_fixed(e0a) => { - match other { - vstore_fixed(e0b) => e0a == e0b, - _ => false - } - } - vstore_uniq => { - match other { - vstore_uniq => true, - _ => false - } - } - vstore_box => { - match other { - vstore_box => true, - _ => false - } - } - vstore_slice(e0a) => { - match other { - vstore_slice(e0b) => e0a == e0b, - _ => false - } - } - } - } - pure fn ne(&&other: vstore) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl vstore : cmp::Eq { pure fn eq(other: &vstore) -> bool { match self { @@ -4154,18 +3985,6 @@ impl vstore : cmp::Eq { pure fn ne(other: &vstore) -> bool { !self.eq(other) } } -#[cfg(stage0)] -impl FnMeta : cmp::Eq { - pure fn eq(&&other: FnMeta) -> bool { - self.purity == other.purity && - self.proto == other.proto && - self.bounds == other.bounds && - self.ret_style == other.ret_style - } - pure fn ne(&&other: FnMeta) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl FnMeta : cmp::Eq { pure fn eq(other: &FnMeta) -> bool { self.purity == (*other).purity && @@ -4176,16 +3995,6 @@ impl FnMeta : cmp::Eq { pure fn ne(other: &FnMeta) -> bool { !self.eq(other) } } -#[cfg(stage0)] -impl FnSig : cmp::Eq { - pure fn eq(&&other: FnSig) -> bool { - self.inputs == other.inputs && - self.output == other.output - } - pure fn ne(&&other: FnSig) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl FnSig : cmp::Eq { pure fn eq(other: &FnSig) -> bool { self.inputs == (*other).inputs && @@ -4194,15 +4003,6 @@ impl FnSig : cmp::Eq { pure fn ne(other: &FnSig) -> bool { !self.eq(other) } } -#[cfg(stage0)] -impl<M: cmp::Eq> FnTyBase<M> : cmp::Eq { - pure fn eq(&&other: FnTyBase<M>) -> bool { - self.meta == other.meta && self.sig == other.sig - } - pure fn ne(&&other: FnTyBase<M>) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl<M: cmp::Eq> FnTyBase<M> : cmp::Eq { pure fn eq(other: &FnTyBase<M>) -> bool { self.meta == (*other).meta && self.sig == (*other).sig @@ -4210,94 +4010,26 @@ impl<M: cmp::Eq> FnTyBase<M> : cmp::Eq { pure fn ne(other: &FnTyBase<M>) -> bool { !self.eq(other) } } -#[cfg(stage0)] -impl TyVid: cmp::Eq { - pure fn eq(&&other: TyVid) -> bool { *self == *other } - pure fn ne(&&other: TyVid) -> bool { *self != *other } -} -#[cfg(stage1)] -#[cfg(stage2)] impl TyVid : cmp::Eq { pure fn eq(other: &TyVid) -> bool { *self == *(*other) } pure fn ne(other: &TyVid) -> bool { *self != *(*other) } } -#[cfg(stage0)] -impl IntVid: cmp::Eq { - pure fn eq(&&other: IntVid) -> bool { *self == *other } - pure fn ne(&&other: IntVid) -> bool { *self != *other } -} -#[cfg(stage1)] -#[cfg(stage2)] impl IntVid : cmp::Eq { pure fn eq(other: &IntVid) -> bool { *self == *(*other) } pure fn ne(other: &IntVid) -> bool { *self != *(*other) } } -#[cfg(stage0)] -impl FnVid: cmp::Eq { - pure fn eq(&&other: FnVid) -> bool { *self == *other } - pure fn ne(&&other: FnVid) -> bool { *self != *other } -} -#[cfg(stage1)] -#[cfg(stage2)] impl FnVid : cmp::Eq { pure fn eq(other: &FnVid) -> bool { *self == *(*other) } pure fn ne(other: &FnVid) -> bool { *self != *(*other) } } -#[cfg(stage0)] -impl RegionVid: cmp::Eq { - pure fn eq(&&other: RegionVid) -> bool { *self == *other } - pure fn ne(&&other: RegionVid) -> bool { *self != *other } -} -#[cfg(stage1)] -#[cfg(stage2)] impl RegionVid : cmp::Eq { pure fn eq(other: &RegionVid) -> bool { *self == *(*other) } pure fn ne(other: &RegionVid) -> bool { *self != *(*other) } } -#[cfg(stage0)] -impl region : cmp::Eq { - pure fn eq(&&other: region) -> bool { - match self { - re_bound(e0a) => { - match other { - re_bound(e0b) => e0a == e0b, - _ => false - } - } - re_free(e0a, e1a) => { - match other { - re_free(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - re_scope(e0a) => { - match other { - re_scope(e0b) => e0a == e0b, - _ => false - } - } - re_static => { - match other { - re_static => true, - _ => false - } - } - re_var(e0a) => { - match other { - re_var(e0b) => e0a == e0b, - _ => false - } - } - } - } - pure fn ne(&&other: region) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl region : cmp::Eq { pure fn eq(other: ®ion) -> bool { match self { @@ -4336,40 +4068,6 @@ impl region : cmp::Eq { pure fn ne(other: ®ion) -> bool { !self.eq(other) } } -#[cfg(stage0)] -impl bound_region : cmp::Eq { - pure fn eq(&&other: bound_region) -> bool { - match self { - br_self => { - match other { - br_self => true, - _ => false - } - } - br_anon(e0a) => { - match other { - br_anon(e0b) => e0a == e0b, - _ => false - } - } - br_named(e0a) => { - match other { - br_named(e0b) => e0a == e0b, - _ => false - } - } - br_cap_avoid(e0a, e1a) => { - match other { - br_cap_avoid(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - } - } - pure fn ne(&&other: bound_region) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl bound_region : cmp::Eq { pure fn eq(other: &bound_region) -> bool { match self { @@ -4402,17 +4100,6 @@ impl bound_region : cmp::Eq { pure fn ne(other: &bound_region) -> bool { !self.eq(other) } } -#[cfg(stage0)] -impl substs : cmp::Eq { - pure fn eq(&&other: substs) -> bool { - self.self_r == other.self_r && - self.self_ty == other.self_ty && - self.tps == other.tps - } - pure fn ne(&&other: substs) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl substs : cmp::Eq { pure fn eq(other: &substs) -> bool { self.self_r == (*other).self_r && @@ -4422,15 +4109,6 @@ impl substs : cmp::Eq { pure fn ne(other: &substs) -> bool { !self.eq(other) } } -#[cfg(stage0)] -impl InferTy : cmp::Eq { - pure fn eq(&&other: InferTy) -> bool { - self.to_hash() == other.to_hash() - } - pure fn ne(&&other: InferTy) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl InferTy : cmp::Eq { pure fn eq(other: &InferTy) -> bool { self.to_hash() == (*other).to_hash() @@ -4438,167 +4116,6 @@ impl InferTy : cmp::Eq { pure fn ne(other: &InferTy) -> bool { !self.eq(other) } } -#[cfg(stage0)] -impl sty : cmp::Eq { - pure fn eq(&&other: sty) -> bool { - match self { - ty_nil => { - match other { - ty_nil => true, - _ => false - } - } - ty_bot => { - match other { - ty_bot => true, - _ => false - } - } - ty_bool => { - match other { - ty_bool => true, - _ => false - } - } - ty_int(e0a) => { - match other { - ty_int(e0b) => e0a == e0b, - _ => false - } - } - ty_uint(e0a) => { - match other { - ty_uint(e0b) => e0a == e0b, - _ => false - } - } - ty_float(e0a) => { - match other { - ty_float(e0b) => e0a == e0b, - _ => false - } - } - ty_estr(e0a) => { - match other { - ty_estr(e0b) => e0a == e0b, - _ => false - } - } - ty_enum(e0a, e1a) => { - match other { - ty_enum(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - ty_box(e0a) => { - match other { - ty_box(e0b) => e0a == e0b, - _ => false - } - } - ty_uniq(e0a) => { - match other { - ty_uniq(e0b) => e0a == e0b, - _ => false - } - } - ty_evec(e0a, e1a) => { - match other { - ty_evec(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - ty_ptr(e0a) => { - match other { - ty_ptr(e0b) => e0a == e0b, - _ => false - } - } - ty_rptr(e0a, e1a) => { - match other { - ty_rptr(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - ty_rec(e0a) => { - match other { - ty_rec(e0b) => e0a == e0b, - _ => false - } - } - ty_fn(e0a) => { - match other { - ty_fn(e0b) => e0a == e0b, - _ => false - } - } - ty_trait(e0a, e1a, e2a) => { - match other { - ty_trait(e0b, e1b, e2b) => - e0a == e0b && e1a == e1b && e2a == e2b, - _ => false - } - } - ty_class(e0a, e1a) => { - match other { - ty_class(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - ty_tup(e0a) => { - match other { - ty_tup(e0b) => e0a == e0b, - _ => false - } - } - ty_infer(e0a) => { - match other { - ty_infer(e0b) => e0a == e0b, - _ => false - } - } - ty_param(e0a) => { - match other { - ty_param(e0b) => e0a == e0b, - _ => false - } - } - ty_self => { - match other { - ty_self => true, - _ => false - } - } - ty_type => { - match other { - ty_type => true, - _ => false - } - } - ty_opaque_box => { - match other { - ty_opaque_box => true, - _ => false - } - } - ty_opaque_closure_ptr(e0a) => { - match other { - ty_opaque_closure_ptr(e0b) => e0a == e0b, - _ => false - } - } - ty_unboxed_vec(e0a) => { - match other { - ty_unboxed_vec(e0b) => e0a == e0b, - _ => false - } - } - } - } - pure fn ne(&&other: sty) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl sty : cmp::Eq { pure fn eq(other: &sty) -> bool { match self { @@ -4758,46 +4275,6 @@ impl sty : cmp::Eq { pure fn ne(other: &sty) -> bool { !self.eq(other) } } -#[cfg(stage0)] -impl param_bound : cmp::Eq { - pure fn eq(&&other: param_bound) -> bool { - match self { - bound_copy => { - match other { - bound_copy => true, - _ => false - } - } - bound_owned => { - match other { - bound_owned => true, - _ => false - } - } - bound_send => { - match other { - bound_send => true, - _ => false - } - } - bound_const => { - match other { - bound_const => true, - _ => false - } - } - bound_trait(e0a) => { - match other { - bound_trait(e0b) => e0a == e0b, - _ => false - } - } - } - } - pure fn ne(&&other: param_bound) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl param_bound : cmp::Eq { pure fn eq(other: ¶m_bound) -> bool { match self { @@ -4836,13 +4313,6 @@ impl param_bound : cmp::Eq { pure fn ne(other: ¶m_bound) -> bool { !self.eq(other) } } -#[cfg(stage0)] -impl kind : cmp::Eq { - pure fn eq(&&other: kind) -> bool { *self == *other } - pure fn ne(&&other: kind) -> bool { *self != *other } -} -#[cfg(stage1)] -#[cfg(stage2)] impl kind : cmp::Eq { pure fn eq(other: &kind) -> bool { *self == *(*other) } pure fn ne(other: &kind) -> bool { *self != *(*other) } diff --git a/src/rustc/middle/typeck/infer/region_var_bindings.rs b/src/rustc/middle/typeck/infer/region_var_bindings.rs index 664c2d37d3c..c0312872488 100644 --- a/src/rustc/middle/typeck/infer/region_var_bindings.rs +++ b/src/rustc/middle/typeck/infer/region_var_bindings.rs @@ -329,28 +329,6 @@ enum Constraint { ConstrainVarSubReg(RegionVid, region) } -#[cfg(stage0)] -impl Constraint: cmp::Eq { - pure fn eq(&&other: Constraint) -> bool { - match (self, other) { - (ConstrainVarSubVar(v0a, v1a), ConstrainVarSubVar(v0b, v1b)) => { - v0a == v0b && v1a == v1b - } - (ConstrainRegSubVar(ra, va), ConstrainRegSubVar(rb, vb)) => { - ra == rb && va == vb - } - (ConstrainVarSubReg(va, ra), ConstrainVarSubReg(vb, rb)) => { - va == vb && ra == rb - } - (ConstrainVarSubVar(*), _) => false, - (ConstrainRegSubVar(*), _) => false, - (ConstrainVarSubReg(*), _) => false - } - } - pure fn ne(&&other: Constraint) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl Constraint : cmp::Eq { pure fn eq(other: &Constraint) -> bool { match (self, (*other)) { @@ -391,15 +369,6 @@ struct TwoRegions { b: region, } -#[cfg(stage0)] -impl TwoRegions: cmp::Eq { - pure fn eq(&&other: TwoRegions) -> bool { - self.a == other.a && self.b == other.b - } - pure fn ne(&&other: TwoRegions) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl TwoRegions : cmp::Eq { pure fn eq(other: &TwoRegions) -> bool { self.a == (*other).a && self.b == (*other).b @@ -786,15 +755,6 @@ priv impl RegionVarBindings { enum Direction { Incoming = 0, Outgoing = 1 } -#[cfg(stage0)] -impl Direction : cmp::Eq { - pure fn eq(&&other: Direction) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: Direction) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl Direction : cmp::Eq { pure fn eq(other: &Direction) -> bool { (self as uint) == ((*other) as uint) @@ -804,15 +764,6 @@ impl Direction : cmp::Eq { enum Classification { Expanding, Contracting } -#[cfg(stage0)] -impl Classification : cmp::Eq { - pure fn eq(&&other: Classification) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: Classification) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl Classification : cmp::Eq { pure fn eq(other: &Classification) -> bool { (self as uint) == ((*other) as uint) |
