From 0419e36b76a3d00dd313dcb3b079604d3440d2ff Mon Sep 17 00:00:00 2001 From: John Clements Date: Thu, 7 Feb 2013 14:39:49 -0800 Subject: finish deriving_eq in ast --- src/libsyntax/ast.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 02f7029fac2..19de5cc62f3 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -783,6 +783,7 @@ pub impl float_ty : to_bytes::IterBytes { // NB Eq method appears below. #[auto_encode] #[auto_decode] +#[deriving_eq] pub struct Ty { id: node_id, node: ty_, @@ -855,6 +856,7 @@ pub struct TyClosure { #[auto_encode] #[auto_decode] +#[deriving_eq] pub struct TyBareFn { purity: purity, abi: Abi, @@ -885,17 +887,6 @@ pub enum ty_ { ty_infer, } -// Equality and byte-iter (hashing) can be quite approximate for AST types. -// since we only care about this for normalizing them to "real" types. -pub impl Ty : cmp::Eq { - pure fn eq(&self, other: &Ty) -> bool { - ptr::addr_of(&(*self)) == ptr::addr_of(&(*other)) - } - pure fn ne(&self, other: &Ty) -> bool { - ptr::addr_of(&(*self)) != ptr::addr_of(&(*other)) - } -} - pub impl Ty : to_bytes::IterBytes { pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) { to_bytes::iter_bytes_2(&self.span.lo, &self.span.hi, lsb0, f); -- cgit 1.4.1-3-g733a5