Skip to content

Commit 0419e36

Browse files
committed
finish deriving_eq in ast
1 parent 819c6d1 commit 0419e36

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/libsyntax/ast.rs

+2-11
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,7 @@ pub impl float_ty : to_bytes::IterBytes {
783783
// NB Eq method appears below.
784784
#[auto_encode]
785785
#[auto_decode]
786+
#[deriving_eq]
786787
pub struct Ty {
787788
id: node_id,
788789
node: ty_,
@@ -855,6 +856,7 @@ pub struct TyClosure {
855856
856857
#[auto_encode]
857858
#[auto_decode]
859+
#[deriving_eq]
858860
pub struct TyBareFn {
859861
purity: purity,
860862
abi: Abi,
@@ -885,17 +887,6 @@ pub enum ty_ {
885887
ty_infer,
886888
}
887889
888-
// Equality and byte-iter (hashing) can be quite approximate for AST types.
889-
// since we only care about this for normalizing them to "real" types.
890-
pub impl Ty : cmp::Eq {
891-
pure fn eq(&self, other: &Ty) -> bool {
892-
ptr::addr_of(&(*self)) == ptr::addr_of(&(*other))
893-
}
894-
pure fn ne(&self, other: &Ty) -> bool {
895-
ptr::addr_of(&(*self)) != ptr::addr_of(&(*other))
896-
}
897-
}
898-
899890
pub impl Ty : to_bytes::IterBytes {
900891
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
901892
to_bytes::iter_bytes_2(&self.span.lo, &self.span.hi, lsb0, f);

0 commit comments

Comments
 (0)