mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 02:33:55 +00:00
Fix auto_serialize test.
This commit is contained in:
parent
11871b8baa
commit
c3ac0f8fd9
@ -42,6 +42,41 @@ enum 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 {
|
||||
pure fn eq(&&other: expr) -> bool {
|
||||
match self {
|
||||
|
Loading…
Reference in New Issue
Block a user