about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs13
1 files changed, 2 insertions, 11 deletions
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);