finish deriving_eq in ast
This commit is contained in:
@@ -783,6 +783,7 @@ pub impl float_ty : to_bytes::IterBytes {
|
|||||||
// NB Eq method appears below.
|
// NB Eq method appears below.
|
||||||
#[auto_encode]
|
#[auto_encode]
|
||||||
#[auto_decode]
|
#[auto_decode]
|
||||||
|
#[deriving_eq]
|
||||||
pub struct Ty {
|
pub struct Ty {
|
||||||
id: node_id,
|
id: node_id,
|
||||||
node: ty_,
|
node: ty_,
|
||||||
@@ -855,6 +856,7 @@ pub struct TyClosure {
|
|||||||
|
|
||||||
#[auto_encode]
|
#[auto_encode]
|
||||||
#[auto_decode]
|
#[auto_decode]
|
||||||
|
#[deriving_eq]
|
||||||
pub struct TyBareFn {
|
pub struct TyBareFn {
|
||||||
purity: purity,
|
purity: purity,
|
||||||
abi: Abi,
|
abi: Abi,
|
||||||
@@ -885,17 +887,6 @@ pub enum ty_ {
|
|||||||
ty_infer,
|
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 {
|
pub impl Ty : to_bytes::IterBytes {
|
||||||
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
|
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
|
||||||
to_bytes::iter_bytes_2(&self.span.lo, &self.span.hi, lsb0, f);
|
to_bytes::iter_bytes_2(&self.span.lo, &self.span.hi, lsb0, f);
|
||||||
|
|||||||
Reference in New Issue
Block a user