diff options
| author | John Clements <clements@racket-lang.org> | 2013-02-07 14:39:49 -0800 |
|---|---|---|
| committer | John Clements <clements@racket-lang.org> | 2013-02-13 15:08:27 -0800 |
| commit | 0419e36b76a3d00dd313dcb3b079604d3440d2ff (patch) | |
| tree | 8a8f032a6af34f755a80a1305dd10754a70f79d9 /src/libsyntax | |
| parent | 819c6d1c048c909fe6bbdde4937dc832cf485849 (diff) | |
| download | rust-0419e36b76a3d00dd313dcb3b079604d3440d2ff.tar.gz rust-0419e36b76a3d00dd313dcb3b079604d3440d2ff.zip | |
finish deriving_eq in ast
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 13 |
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); |
