Fix auto_serialize test.
This commit is contained in:
parent
11871b8baa
commit
c3ac0f8fd9
1 changed files with 35 additions and 0 deletions
|
@ -42,6 +42,41 @@ enum expr {
|
||||||
minus(@expr, @expr)
|
minus(@expr, @expr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl an_enum : cmp::Eq {
|
||||||
|
pure fn eq(&&other: an_enum) -> bool {
|
||||||
|
self.v == other.v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl point : cmp::Eq {
|
||||||
|
pure fn eq(&&other: point) -> bool {
|
||||||
|
self.x == other.x &&
|
||||||
|
self.y == other.y
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<T:cmp::Eq> quark<T> : cmp::Eq {
|
||||||
|
pure fn eq(&&other: quark<T>) -> bool {
|
||||||
|
match self {
|
||||||
|
top(ref q) => match other {
|
||||||
|
top(ref r) => q == r,
|
||||||
|
bottom(_) => false
|
||||||
|
},
|
||||||
|
bottom(ref q) => match other {
|
||||||
|
top(_) => false,
|
||||||
|
bottom(ref r) => q == r
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
impl c_like : cmp::Eq {
|
||||||
|
pure fn eq(&&other: c_like) -> bool {
|
||||||
|
self as int == other as int
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl expr : cmp::Eq {
|
impl expr : cmp::Eq {
|
||||||
pure fn eq(&&other: expr) -> bool {
|
pure fn eq(&&other: expr) -> bool {
|
||||||
match self {
|
match self {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue