diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-09-23 22:25:43 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-09-23 23:01:49 -0700 |
| commit | afd91f8a5698e7767ddfbf90c665c08dcd4f0de0 (patch) | |
| tree | 3bc5d52fd888c010ea797f6570c92abe861c183a /src/libsyntax | |
| parent | 2dae768624de87bcec1160bd29c27af1affe7f5f (diff) | |
| download | rust-afd91f8a5698e7767ddfbf90c665c08dcd4f0de0.tar.gz rust-afd91f8a5698e7767ddfbf90c665c08dcd4f0de0.zip | |
Register snapshots. Remove redundant Eq impls, Makefile hacks
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 581 | ||||
| -rw-r--r-- | src/libsyntax/ast_map.rs | 22 | ||||
| -rw-r--r-- | src/libsyntax/attr.rs | 9 | ||||
| -rw-r--r-- | src/libsyntax/codemap.rs | 18 | ||||
| -rw-r--r-- | src/libsyntax/diagnostic.rs | 9 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/proto.rs | 14 | ||||
| -rw-r--r-- | src/libsyntax/parse/comments.rs | 11 | ||||
| -rw-r--r-- | src/libsyntax/parse/obsolete.rs | 11 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 9 | ||||
| -rw-r--r-- | src/libsyntax/parse/token.rs | 277 | ||||
| -rw-r--r-- | src/libsyntax/print/pp.rs | 14 |
11 files changed, 0 insertions, 975 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 94536924afe..e9f47e14dbb 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -81,15 +81,6 @@ type node_id = int; #[auto_serialize] type def_id = {crate: crate_num, node: node_id}; -#[cfg(stage0)] -impl def_id: cmp::Eq { - pure fn eq(&&other: def_id) -> bool { - self.crate == other.crate && self.node == other.node - } - pure fn ne(&&other: def_id) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl def_id : cmp::Eq { pure fn eq(other: &def_id) -> bool { self.crate == (*other).crate && self.node == (*other).node @@ -138,131 +129,6 @@ enum def { def_label(node_id) } -#[cfg(stage0)] -impl def : cmp::Eq { - pure fn eq(&&other: def) -> bool { - match self { - def_fn(e0a, e1a) => { - match other { - def_fn(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - def_static_method(e0a, e1a) => { - match other { - def_static_method(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - def_self(e0a) => { - match other { - def_self(e0b) => e0a == e0b, - _ => false - } - } - def_mod(e0a) => { - match other { - def_mod(e0b) => e0a == e0b, - _ => false - } - } - def_foreign_mod(e0a) => { - match other { - def_foreign_mod(e0b) => e0a == e0b, - _ => false - } - } - def_const(e0a) => { - match other { - def_const(e0b) => e0a == e0b, - _ => false - } - } - def_arg(e0a, e1a) => { - match other { - def_arg(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - def_local(e0a, e1a) => { - match other { - def_local(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - def_variant(e0a, e1a) => { - match other { - def_variant(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - def_ty(e0a) => { - match other { - def_ty(e0b) => e0a == e0b, - _ => false - } - } - def_prim_ty(e0a) => { - match other { - def_prim_ty(e0b) => e0a == e0b, - _ => false - } - } - def_ty_param(e0a, e1a) => { - match other { - def_ty_param(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - def_binding(e0a, e1a) => { - match other { - def_binding(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - def_use(e0a) => { - match other { - def_use(e0b) => e0a == e0b, - _ => false - } - } - def_upvar(e0a, e1a, e2a, e3a) => { - match other { - def_upvar(e0b, e1b, e2b, e3b) => - e0a == e0b && e1a == e1b && e2a == e2b && e3a == e3b, - _ => false - } - } - def_class(e0a, e1a) => { - match other { - def_class(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - def_typaram_binder(e0a) => { - match other { - def_typaram_binder(e1a) => e0a == e1a, - _ => false - } - } - def_region(e0a) => { - match other { - def_region(e0b) => e0a == e0b, - _ => false - } - } - def_label(e0a) => { - match other { - def_label(e0b) => e0a == e0b, - _ => false - } - } - } - } - pure fn ne(&&other: def) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl def : cmp::Eq { pure fn eq(other: &def) -> bool { match self { @@ -464,40 +330,6 @@ impl binding_mode : to_bytes::IterBytes { } } -#[cfg(stage0)] -impl binding_mode : cmp::Eq { - pure fn eq(&&other: binding_mode) -> bool { - match self { - bind_by_value => { - match other { - bind_by_value => true, - _ => false - } - } - bind_by_move => { - match other { - bind_by_move => true, - _ => false - } - } - bind_by_ref(e0a) => { - match other { - bind_by_ref(e0b) => e0a == e0b, - _ => false - } - } - bind_by_implicit_ref => { - match other { - bind_by_implicit_ref => true, - _ => false - } - } - } - } - pure fn ne(&&other: binding_mode) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl binding_mode : cmp::Eq { pure fn eq(other: &binding_mode) -> bool { match self { @@ -562,15 +394,6 @@ impl mutability : to_bytes::IterBytes { } } -#[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) @@ -586,15 +409,6 @@ enum proto { proto_block, // fn& } -#[cfg(stage0)] -impl proto : cmp::Eq { - pure fn eq(&&other: proto) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: proto) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl proto : cmp::Eq { pure fn eq(other: &proto) -> bool { (self as uint) == ((*other) as uint) @@ -649,15 +463,6 @@ enum binop { gt, } -#[cfg(stage0)] -impl binop : cmp::Eq { - pure fn eq(&&other: binop) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: binop) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl binop : cmp::Eq { pure fn eq(other: &binop) -> bool { (self as uint) == ((*other) as uint) @@ -674,48 +479,6 @@ enum unop { neg } -#[cfg(stage0)] -impl unop : cmp::Eq { - pure fn eq(&&other: unop) -> bool { - match self { - box(e0a) => { - match other { - box(e0b) => e0a == e0b, - _ => false - } - } - uniq(e0a) => { - match other { - uniq(e0b) => e0a == e0b, - _ => false - } - } - deref => { - match other { - deref => true, - _ => false - } - } - not => { - match other { - not => true, - _ => false - } - } - neg => { - match other { - neg => true, - _ => false - } - } - } - } - pure fn ne(&&other: unop) -> bool { - !self.eq(other) - } -} -#[cfg(stage1)] -#[cfg(stage2)] impl unop : cmp::Eq { pure fn eq(other: &unop) -> bool { match self { @@ -776,28 +539,6 @@ impl<T: to_bytes::IterBytes> inferable<T> : to_bytes::IterBytes { } } -#[cfg(stage0)] -impl<T:cmp::Eq> inferable<T> : cmp::Eq { - pure fn eq(&&other: inferable<T>) -> bool { - match self { - expl(e0a) => { - match other { - expl(e0b) => e0a == e0b, - _ => false - } - } - infer(e0a) => { - match other { - infer(e0b) => e0a == e0b, - _ => false - } - } - } - } - pure fn ne(&&other: inferable<T>) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl<T:cmp::Eq> inferable<T> : cmp::Eq { pure fn eq(other: &inferable<T>) -> bool { match self { @@ -829,15 +570,6 @@ impl rmode : to_bytes::IterBytes { } -#[cfg(stage0)] -impl rmode : cmp::Eq { - pure fn eq(&&other: rmode) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: rmode) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl rmode : cmp::Eq { pure fn eq(other: &rmode) -> bool { (self as uint) == ((*other) as uint) @@ -866,28 +598,6 @@ enum stmt_ { #[auto_serialize] enum init_op { init_assign, init_move, } -#[cfg(stage0)] -impl init_op : cmp::Eq { - pure fn eq(&&other: init_op) -> bool { - match self { - init_assign => { - match other { - init_assign => true, - _ => false - } - } - init_move => { - match other { - init_move => true, - _ => false - } - } - } - } - pure fn ne(&&other: init_op) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl init_op : cmp::Eq { pure fn eq(other: &init_op) -> bool { match self { @@ -938,20 +648,6 @@ type field = spanned<field_>; #[auto_serialize] enum blk_check_mode { default_blk, unsafe_blk, } -#[cfg(stage0)] -impl blk_check_mode : cmp::Eq { - pure fn eq(&&other: blk_check_mode) -> bool { - match (self, other) { - (default_blk, default_blk) => true, - (unsafe_blk, unsafe_blk) => true, - (default_blk, _) => false, - (unsafe_blk, _) => false, - } - } - pure fn ne(&&other: blk_check_mode) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl blk_check_mode : cmp::Eq { pure fn eq(other: &blk_check_mode) -> bool { match (self, (*other)) { @@ -1171,36 +867,6 @@ enum lit_ { lit_bool(bool), } -#[cfg(stage0)] -impl ast::lit_: cmp::Eq { - pure fn eq(&&other: ast::lit_) -> bool { - match (self, other) { - (lit_str(a), lit_str(b)) => a == b, - (lit_int(val_a, ty_a), lit_int(val_b, ty_b)) => { - val_a == val_b && ty_a == ty_b - } - (lit_uint(val_a, ty_a), lit_uint(val_b, ty_b)) => { - val_a == val_b && ty_a == ty_b - } - (lit_int_unsuffixed(a), lit_int_unsuffixed(b)) => a == b, - (lit_float(val_a, ty_a), lit_float(val_b, ty_b)) => { - val_a == val_b && ty_a == ty_b - } - (lit_nil, lit_nil) => true, - (lit_bool(a), lit_bool(b)) => a == b, - (lit_str(_), _) => false, - (lit_int(*), _) => false, - (lit_uint(*), _) => false, - (lit_int_unsuffixed(*), _) => false, - (lit_float(*), _) => false, - (lit_nil, _) => false, - (lit_bool(_), _) => false - } - } - pure fn ne(&&other: ast::lit_) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl ast::lit_: cmp::Eq { pure fn eq(other: &ast::lit_) -> bool { match (self, *other) { @@ -1263,28 +929,6 @@ impl int_ty : to_bytes::IterBytes { } } -#[cfg(stage0)] -impl int_ty: cmp::Eq { - pure fn eq(&&other: int_ty) -> bool { - match (self, other) { - (ty_i, ty_i) => true, - (ty_char, ty_char) => true, - (ty_i8, ty_i8) => true, - (ty_i16, ty_i16) => true, - (ty_i32, ty_i32) => true, - (ty_i64, ty_i64) => true, - (ty_i, _) => false, - (ty_char, _) => false, - (ty_i8, _) => false, - (ty_i16, _) => false, - (ty_i32, _) => false, - (ty_i64, _) => false, - } - } - pure fn ne(&&other: int_ty) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl int_ty : cmp::Eq { pure fn eq(other: &int_ty) -> bool { match (self, (*other)) { @@ -1314,26 +958,6 @@ impl uint_ty : to_bytes::IterBytes { } } -#[cfg(stage0)] -impl uint_ty: cmp::Eq { - pure fn eq(&&other: uint_ty) -> bool { - match (self, other) { - (ty_u, ty_u) => true, - (ty_u8, ty_u8) => true, - (ty_u16, ty_u16) => true, - (ty_u32, ty_u32) => true, - (ty_u64, ty_u64) => true, - (ty_u, _) => false, - (ty_u8, _) => false, - (ty_u16, _) => false, - (ty_u32, _) => false, - (ty_u64, _) => false - } - } - pure fn ne(&&other: uint_ty) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl uint_ty : cmp::Eq { pure fn eq(other: &uint_ty) -> bool { match (self, (*other)) { @@ -1360,18 +984,6 @@ impl float_ty : to_bytes::IterBytes { (self as u8).iter_bytes(lsb0, f) } } -#[cfg(stage0)] -impl float_ty: cmp::Eq { - pure fn eq(&&other: float_ty) -> bool { - match (self, other) { - (ty_f, ty_f) | (ty_f32, ty_f32) | (ty_f64, ty_f64) => true, - (ty_f, _) | (ty_f32, _) | (ty_f64, _) => false - } - } - pure fn ne(&&other: float_ty) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl float_ty : cmp::Eq { pure fn eq(other: &float_ty) -> bool { match (self, (*other)) { @@ -1395,46 +1007,6 @@ enum prim_ty { ty_bool, } -#[cfg(stage0)] -impl prim_ty : cmp::Eq { - pure fn eq(&&other: prim_ty) -> bool { - match self { - 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_str => { - match other { - ty_str => true, - _ => false - } - } - ty_bool => { - match other { - ty_bool => true, - _ => false - } - } - } - } - pure fn ne(&&other: prim_ty) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl prim_ty : cmp::Eq { pure fn eq(other: &prim_ty) -> bool { match self { @@ -1507,17 +1079,6 @@ enum ty_ { // Equality and byte-iter (hashing) can be quite approximate for AST types. // since we only care about this for normalizing them to "real" types. -#[cfg(stage0)] -impl ty : cmp::Eq { - pure fn eq(&&other: ty) -> bool { - ptr::addr_of(self) == ptr::addr_of(other) - } - pure fn ne(&&other: ty) -> bool { - ptr::addr_of(self) != ptr::addr_of(other) - } -} -#[cfg(stage1)] -#[cfg(stage2)] impl ty : cmp::Eq { pure fn eq(other: &ty) -> bool { ptr::addr_of(self) == ptr::addr_of((*other)) @@ -1557,15 +1118,6 @@ impl purity : to_bytes::IterBytes { } } -#[cfg(stage0)] -impl purity : cmp::Eq { - pure fn eq(&&other: purity) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: purity) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl purity : cmp::Eq { pure fn eq(other: &purity) -> bool { (self as uint) == ((*other) as uint) @@ -1586,20 +1138,6 @@ impl ret_style : to_bytes::IterBytes { } } -#[cfg(stage0)] -impl ret_style : cmp::Eq { - pure fn eq(&&other: ret_style) -> bool { - match (self, other) { - (noreturn, noreturn) => true, - (return_val, return_val) => true, - (noreturn, _) => false, - (return_val, _) => false, - } - } - pure fn ne(&&other: ret_style) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl ret_style : cmp::Eq { pure fn eq(other: &ret_style) -> bool { match (self, (*other)) { @@ -1622,52 +1160,6 @@ enum self_ty_ { sty_uniq(mutability) // by-unique-pointer self: `~self` } -#[cfg(stage0)] -impl self_ty_ : cmp::Eq { - pure fn eq(&&other: self_ty_) -> bool { - match self { - sty_static => { - match other { - sty_static => true, - _ => false - } - } - sty_by_ref => { - match other { - sty_by_ref => true, - _ => false - } - } - sty_value => { - match other { - sty_value => true, - _ => false - } - } - sty_region(e0a) => { - match other { - sty_region(e0b) => e0a == e0b, - _ => false - } - } - sty_box(e0a) => { - match other { - sty_box(e0b) => e0a == e0b, - _ => false - } - } - sty_uniq(e0a) => { - match other { - sty_uniq(e0b) => e0a == e0b, - _ => false - } - } - } - } - pure fn ne(&&other: self_ty_) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl self_ty_ : cmp::Eq { pure fn eq(other: &self_ty_) -> bool { match self { @@ -1736,15 +1228,6 @@ enum foreign_abi { #[auto_serialize] enum foreign_mod_sort { named, anonymous } -#[cfg(stage0)] -impl foreign_mod_sort : cmp::Eq { - pure fn eq(&&other: foreign_mod_sort) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: foreign_mod_sort) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl foreign_mod_sort : cmp::Eq { pure fn eq(other: &foreign_mod_sort) -> bool { (self as uint) == ((*other) as uint) @@ -1752,22 +1235,6 @@ impl foreign_mod_sort : cmp::Eq { pure fn ne(other: &foreign_mod_sort) -> bool { !self.eq(other) } } -#[cfg(stage0)] -impl foreign_abi : cmp::Eq { - pure fn eq(&&other: foreign_abi) -> bool { - match (self, other) { - (foreign_abi_rust_intrinsic, foreign_abi_rust_intrinsic) => true, - (foreign_abi_cdecl, foreign_abi_cdecl) => true, - (foreign_abi_stdcall, foreign_abi_stdcall) => true, - (foreign_abi_rust_intrinsic, _) => false, - (foreign_abi_cdecl, _) => false, - (foreign_abi_stdcall, _) => false, - } - } - pure fn ne(&&other: foreign_abi) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl foreign_abi : cmp::Eq { pure fn eq(other: &foreign_abi) -> bool { match (self, (*other)) { @@ -1817,15 +1284,6 @@ type path_list_ident = spanned<path_list_ident_>; #[auto_serialize] enum namespace { module_ns, type_value_ns } -#[cfg(stage0)] -impl namespace : cmp::Eq { - pure fn eq(&&other: namespace) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: namespace) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl namespace : cmp::Eq { pure fn eq(other: &namespace) -> bool { (self as uint) == ((*other) as uint) @@ -1874,15 +1332,6 @@ type attribute = spanned<attribute_>; #[auto_serialize] enum attr_style { attr_outer, attr_inner, } -#[cfg(stage0)] -impl attr_style : cmp::Eq { - pure fn eq(&&other: attr_style) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: attr_style) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl attr_style : cmp::Eq { pure fn eq(other: &attr_style) -> bool { (self as uint) == ((*other) as uint) @@ -1909,22 +1358,6 @@ type trait_ref = {path: @path, ref_id: node_id, impl_id: node_id}; #[auto_serialize] enum visibility { public, private, inherited } -#[cfg(stage0)] -impl visibility : cmp::Eq { - pure fn eq(&&other: visibility) -> bool { - match (self, other) { - (public, public) => true, - (private, private) => true, - (inherited, inherited) => true, - (public, _) => false, - (private, _) => false, - (inherited, _) => false, - } - } - pure fn ne(&&other: visibility) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl visibility : cmp::Eq { pure fn eq(other: &visibility) -> bool { match (self, (*other)) { @@ -2002,20 +1435,6 @@ impl class_mutability : to_bytes::IterBytes { } } -#[cfg(stage0)] -impl class_mutability : cmp::Eq { - pure fn eq(&&other: class_mutability) -> bool { - match (self, other) { - (class_mutable, class_mutable) => true, - (class_immutable, class_immutable) => true, - (class_mutable, _) => false, - (class_immutable, _) => false, - } - } - pure fn ne(&&other: class_mutability) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl class_mutability : cmp::Eq { pure fn eq(other: &class_mutability) -> bool { match (self, (*other)) { diff --git a/src/libsyntax/ast_map.rs b/src/libsyntax/ast_map.rs index 85de1e1c60f..9a3e94b737f 100644 --- a/src/libsyntax/ast_map.rs +++ b/src/libsyntax/ast_map.rs @@ -11,28 +11,6 @@ enum path_elt { path_name(ident) } -#[cfg(stage0)] -impl path_elt : cmp::Eq { - pure fn eq(&&other: path_elt) -> bool { - match self { - path_mod(e0a) => { - match other { - path_mod(e0b) => e0a == e0b, - _ => false - } - } - path_name(e0a) => { - match other { - path_name(e0b) => e0a == e0b, - _ => false - } - } - } - } - pure fn ne(&&other: path_elt) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl path_elt : cmp::Eq { pure fn eq(other: &path_elt) -> bool { match self { diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index a710b558594..eb4ffb26fb1 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -337,15 +337,6 @@ enum inline_attr { ia_never, } -#[cfg(stage0)] -impl inline_attr : cmp::Eq { - pure fn eq(&&other: inline_attr) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: inline_attr) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl inline_attr : cmp::Eq { pure fn eq(other: &inline_attr) -> bool { (self as uint) == ((*other) as uint) diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 6340e10429d..ae49e19c862 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -32,15 +32,6 @@ type filename = ~str; type file_pos = {ch: uint, byte: uint}; -#[cfg(stage0)] -impl file_pos: cmp::Eq { - pure fn eq(&&other: file_pos) -> bool { - self.ch == other.ch && self.byte == other.byte - } - pure fn ne(&&other: file_pos) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl file_pos : cmp::Eq { pure fn eq(other: &file_pos) -> bool { self.ch == (*other).ch && self.byte == (*other).byte @@ -180,15 +171,6 @@ type expn_info = Option<@expn_info_>; type span = {lo: uint, hi: uint, expn_info: expn_info}; -#[cfg(stage0)] -impl span : cmp::Eq { - pure fn eq(&&other: span) -> bool { - return self.lo == other.lo && self.hi == other.hi; - } - pure fn ne(&&other: span) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl span : cmp::Eq { pure fn eq(other: &span) -> bool { return self.lo == (*other).lo && self.hi == (*other).hi; diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs index abeddbdd69a..ca9db6d25ad 100644 --- a/src/libsyntax/diagnostic.rs +++ b/src/libsyntax/diagnostic.rs @@ -146,15 +146,6 @@ enum level { note, } -#[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/libsyntax/ext/pipes/proto.rs b/src/libsyntax/ext/pipes/proto.rs index 5ddc492d0fb..70b38e83ad5 100644 --- a/src/libsyntax/ext/pipes/proto.rs +++ b/src/libsyntax/ext/pipes/proto.rs @@ -5,20 +5,6 @@ use ast_builder::{path, append_types}; enum direction { send, recv } -#[cfg(stage0)] -impl direction : cmp::Eq { - pure fn eq(&&other: direction) -> bool { - match (self, other) { - (send, send) => true, - (recv, recv) => true, - (send, _) => false, - (recv, _) => false, - } - } - pure fn ne(&&other: direction) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl direction : cmp::Eq { pure fn eq(other: &direction) -> bool { match (self, (*other)) { diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs index 471a800b382..9c705cff7bb 100644 --- a/src/libsyntax/parse/comments.rs +++ b/src/libsyntax/parse/comments.rs @@ -17,17 +17,6 @@ enum cmnt_style { blank_line, // Just a manual blank line "\n\n", for layout } -#[cfg(stage0)] -impl cmnt_style : cmp::Eq { - pure fn eq(&&other: cmnt_style) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: cmnt_style) -> bool { - (self as uint) != (other as uint) - } -} -#[cfg(stage1)] -#[cfg(stage2)] impl cmnt_style : cmp::Eq { pure fn eq(other: &cmnt_style) -> bool { (self as uint) == ((*other) as uint) diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs index d787123bf61..9cfa84ad9e0 100644 --- a/src/libsyntax/parse/obsolete.rs +++ b/src/libsyntax/parse/obsolete.rs @@ -25,17 +25,6 @@ pub enum ObsoleteSyntax { ObsoleteModeInFnType } -#[cfg(stage0)] -impl ObsoleteSyntax : cmp::Eq { - pure fn eq(&&other: ObsoleteSyntax) -> bool { - self as uint == other as uint - } - pure fn ne(&&other: ObsoleteSyntax) -> bool { - !self.eq(other) - } -} -#[cfg(stage1)] -#[cfg(stage2)] impl ObsoleteSyntax : cmp::Eq { pure fn eq(other: &ObsoleteSyntax) -> bool { self as uint == (*other) as uint diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 490808edaad..2ffe69c8b10 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3657,15 +3657,6 @@ impl parser { } } -#[cfg(stage0)] -impl restriction : cmp::Eq { - pure fn eq(&&other: restriction) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: restriction) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl restriction : cmp::Eq { pure fn eq(other: &restriction) -> bool { (self as uint) == ((*other) as uint) diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 37f2e6bd189..0f9041a2fcd 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -436,15 +436,6 @@ fn reserved_keyword_table() -> HashMap<~str, ()> { words } -#[cfg(stage0)] -impl binop : cmp::Eq { - pure fn eq(&&other: binop) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: binop) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl binop : cmp::Eq { pure fn eq(other: &binop) -> bool { (self as uint) == ((*other) as uint) @@ -452,274 +443,6 @@ impl binop : cmp::Eq { pure fn ne(other: &binop) -> bool { !self.eq(other) } } -#[cfg(stage0)] -impl token : cmp::Eq { - pure fn eq(&&other: token) -> bool { - match self { - EQ => { - match other { - EQ => true, - _ => false - } - } - LT => { - match other { - LT => true, - _ => false - } - } - LE => { - match other { - LE => true, - _ => false - } - } - EQEQ => { - match other { - EQEQ => true, - _ => false - } - } - NE => { - match other { - NE => true, - _ => false - } - } - GE => { - match other { - GE => true, - _ => false - } - } - GT => { - match other { - GT => true, - _ => false - } - } - ANDAND => { - match other { - ANDAND => true, - _ => false - } - } - OROR => { - match other { - OROR => true, - _ => false - } - } - NOT => { - match other { - NOT => true, - _ => false - } - } - TILDE => { - match other { - TILDE => true, - _ => false - } - } - BINOP(e0a) => { - match other { - BINOP(e0b) => e0a == e0b, - _ => false - } - } - BINOPEQ(e0a) => { - match other { - BINOPEQ(e0b) => e0a == e0b, - _ => false - } - } - AT => { - match other { - AT => true, - _ => false - } - } - DOT => { - match other { - DOT => true, - _ => false - } - } - DOTDOT => { - match other { - DOTDOT => true, - _ => false - } - } - ELLIPSIS => { - match other { - ELLIPSIS => true, - _ => false - } - } - COMMA => { - match other { - COMMA => true, - _ => false - } - } - SEMI => { - match other { - SEMI => true, - _ => false - } - } - COLON => { - match other { - COLON => true, - _ => false - } - } - MOD_SEP => { - match other { - MOD_SEP => true, - _ => false - } - } - RARROW => { - match other { - RARROW => true, - _ => false - } - } - LARROW => { - match other { - LARROW => true, - _ => false - } - } - DARROW => { - match other { - DARROW => true, - _ => false - } - } - FAT_ARROW => { - match other { - FAT_ARROW => true, - _ => false - } - } - LPAREN => { - match other { - LPAREN => true, - _ => false - } - } - RPAREN => { - match other { - RPAREN => true, - _ => false - } - } - LBRACKET => { - match other { - LBRACKET => true, - _ => false - } - } - RBRACKET => { - match other { - RBRACKET => true, - _ => false - } - } - LBRACE => { - match other { - LBRACE => true, - _ => false - } - } - RBRACE => { - match other { - RBRACE => true, - _ => false - } - } - POUND => { - match other { - POUND => true, - _ => false - } - } - DOLLAR => { - match other { - DOLLAR => true, - _ => false - } - } - LIT_INT(e0a, e1a) => { - match other { - LIT_INT(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - LIT_UINT(e0a, e1a) => { - match other { - LIT_UINT(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - LIT_INT_UNSUFFIXED(e0a) => { - match other { - LIT_INT_UNSUFFIXED(e0b) => e0a == e0b, - _ => false - } - } - LIT_FLOAT(e0a, e1a) => { - match other { - LIT_FLOAT(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - LIT_STR(e0a) => { - match other { - LIT_STR(e0b) => e0a == e0b, - _ => false - } - } - IDENT(e0a, e1a) => { - match other { - IDENT(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - UNDERSCORE => { - match other { - UNDERSCORE => true, - _ => false - } - } - INTERPOLATED(_) => { - match other { - INTERPOLATED(_) => true, - _ => false - } - } - DOC_COMMENT(e0a) => { - match other { - DOC_COMMENT(e0b) => e0a == e0b, - _ => false - } - } - EOF => { - match other { - EOF => true, - _ => false - } - } - } - } - pure fn ne(&&other: token) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl token : cmp::Eq { pure fn eq(other: &token) -> bool { match self { diff --git a/src/libsyntax/print/pp.rs b/src/libsyntax/print/pp.rs index c69739e4cf6..d474aaeaa0b 100644 --- a/src/libsyntax/print/pp.rs +++ b/src/libsyntax/print/pp.rs @@ -55,20 +55,6 @@ use dvec::DVec; */ enum breaks { consistent, inconsistent, } -#[cfg(stage0)] -impl breaks : cmp::Eq { - pure fn eq(&&other: breaks) -> bool { - match (self, other) { - (consistent, consistent) => true, - (inconsistent, inconsistent) => true, - (consistent, _) => false, - (inconsistent, _) => false, - } - } - pure fn ne(&&other: breaks) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl breaks : cmp::Eq { pure fn eq(other: &breaks) -> bool { match (self, (*other)) { |
