diff options
Diffstat (limited to 'src/libstd/deque.rs')
| -rw-r--r-- | src/libstd/deque.rs | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/src/libstd/deque.rs b/src/libstd/deque.rs index 44ddb307019..f33ff892f36 100644 --- a/src/libstd/deque.rs +++ b/src/libstd/deque.rs @@ -239,25 +239,6 @@ mod tests { type RecCy = {x: int, y: int, t: Taggy}; impl Taggy : Eq { - #[cfg(stage0)] - pure fn eq(other: &Taggy) -> bool { - match self { - One(a1) => match (*other) { - One(b1) => return a1 == b1, - _ => return false - }, - Two(a1, a2) => match (*other) { - Two(b1, b2) => return a1 == b1 && a2 == b2, - _ => return false - }, - Three(a1, a2, a3) => match (*other) { - Three(b1, b2, b3) => return a1 == b1 && a2 == b2 && a3 == b3, - _ => return false - } - } - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &Taggy) -> bool { match (*self) { One(a1) => match (*other) { @@ -274,36 +255,11 @@ mod tests { } } } - #[cfg(stage0)] - pure fn ne(other: &Taggy) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &Taggy) -> bool { !(*self).eq(other) } } impl Taggypar<int> : Eq { //let eq4: EqFn<Taggypar<int>> = |x,y| taggypareq::<int>(x, y); - #[cfg(stage0)] - pure fn eq(other: &Taggypar<int>) -> bool { - match self { - Onepar::<int>(a1) => match (*other) { - Onepar::<int>(b1) => return a1 == b1, - _ => return false - }, - Twopar::<int>(a1, a2) => match (*other) { - Twopar::<int>(b1, b2) => return a1 == b1 && a2 == b2, - _ => return false - }, - Threepar::<int>(a1, a2, a3) => match (*other) { - Threepar::<int>(b1, b2, b3) => { - return a1 == b1 && a2 == b2 && a3 == b3 - } - _ => return false - } - } - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &Taggypar<int>) -> bool { match (*self) { Onepar::<int>(a1) => match (*other) { @@ -322,33 +278,16 @@ mod tests { } } } - #[cfg(stage0)] - pure fn ne(other: &Taggypar<int>) -> bool { - !self.eq(other) - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &Taggypar<int>) -> bool { !(*self).eq(other) } } impl RecCy : Eq { - #[cfg(stage0)] - pure fn eq(other: &RecCy) -> bool { - return self.x == (*other).x && self.y == (*other).y && - self.t == (*other).t; - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &RecCy) -> bool { return (*self).x == (*other).x && (*self).y == (*other).y && (*self).t == (*other).t; } - #[cfg(stage0)] - pure fn ne(other: &RecCy) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &RecCy) -> bool { !(*self).eq(other) } } |
