diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-09-23 22:25:43 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-09-23 23:01:49 -0700 |
| commit | afd91f8a5698e7767ddfbf90c665c08dcd4f0de0 (patch) | |
| tree | 3bc5d52fd888c010ea797f6570c92abe861c183a /src/libstd | |
| parent | 2dae768624de87bcec1160bd29c27af1affe7f5f (diff) | |
| download | rust-afd91f8a5698e7767ddfbf90c665c08dcd4f0de0.tar.gz rust-afd91f8a5698e7767ddfbf90c665c08dcd4f0de0.zip | |
Register snapshots. Remove redundant Eq impls, Makefile hacks
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/deque.rs | 56 | ||||
| -rw-r--r-- | src/libstd/getopts.rs | 40 | ||||
| -rw-r--r-- | src/libstd/json.rs | 27 | ||||
| -rw-r--r-- | src/libstd/list.rs | 22 | ||||
| -rw-r--r-- | src/libstd/net_url.rs | 43 | ||||
| -rw-r--r-- | src/libstd/test.rs | 9 | ||||
| -rw-r--r-- | src/libstd/time.rs | 36 |
7 files changed, 0 insertions, 233 deletions
diff --git a/src/libstd/deque.rs b/src/libstd/deque.rs index 05875636415..17d4b39b01e 100644 --- a/src/libstd/deque.rs +++ b/src/libstd/deque.rs @@ -240,28 +240,6 @@ mod tests { type RecCy = {x: int, y: int, t: Taggy}; -#[cfg(stage0)] - impl Taggy : Eq { - 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 - } - } - } - pure fn ne(other: Taggy) -> bool { !self.eq(other) } - } - #[cfg(stage1)] - #[cfg(stage2)] impl Taggy : Eq { pure fn eq(other: &Taggy) -> bool { match self { @@ -282,31 +260,6 @@ mod tests { pure fn ne(other: &Taggy) -> bool { !self.eq(other) } } -#[cfg(stage0)] - impl Taggypar<int> : Eq { - //let eq4: EqFn<Taggypar<int>> = |x,y| taggypareq::<int>(x, y); - 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 - } - } - } - pure fn ne(other: Taggypar<int>) -> bool { !self.eq(other) } - } - #[cfg(stage1)] - #[cfg(stage2)] impl Taggypar<int> : Eq { //let eq4: EqFn<Taggypar<int>> = |x,y| taggypareq::<int>(x, y); pure fn eq(other: &Taggypar<int>) -> bool { @@ -330,15 +283,6 @@ mod tests { pure fn ne(other: &Taggypar<int>) -> bool { !self.eq(other) } } -#[cfg(stage0)] - impl RecCy : Eq { - pure fn eq(other: RecCy) -> bool { - return self.x == other.x && self.y == other.y && self.t == other.t; - } - pure fn ne(other: RecCy) -> bool { !self.eq(other) } - } - #[cfg(stage1)] - #[cfg(stage2)] impl RecCy : Eq { pure fn eq(other: &RecCy) -> bool { return self.x == (*other).x && self.y == (*other).y && diff --git a/src/libstd/getopts.rs b/src/libstd/getopts.rs index c8d1c6026c7..f8b86d80061 100644 --- a/src/libstd/getopts.rs +++ b/src/libstd/getopts.rs @@ -107,28 +107,6 @@ fn mkname(nm: &str) -> Name { } else { Long(unm) }; } -#[cfg(stage0)] -impl Name : Eq { - pure fn eq(&&other: Name) -> bool { - match self { - Long(e0a) => { - match other { - Long(e0b) => e0a == e0b, - _ => false - } - } - Short(e0a) => { - match other { - Short(e0b) => e0a == e0b, - _ => false - } - } - } - } - pure fn ne(&&other: Name) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl Name : Eq { pure fn eq(other: &Name) -> bool { match self { @@ -149,15 +127,6 @@ impl Name : Eq { pure fn ne(other: &Name) -> bool { !self.eq(other) } } -#[cfg(stage0)] -impl Occur : Eq { - pure fn eq(&&other: Occur) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: Occur) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl Occur : Eq { pure fn eq(other: &Occur) -> bool { (self as uint) == ((*other) as uint) @@ -478,15 +447,6 @@ enum FailType { UnexpectedArgument_, } -#[cfg(stage0)] -impl FailType : Eq { - pure fn eq(&&other: FailType) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: FailType) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl FailType : Eq { pure fn eq(other: &FailType) -> bool { (self as uint) == ((*other) as uint) diff --git a/src/libstd/json.rs b/src/libstd/json.rs index 6b80aa716a0..0f7bec6344a 100644 --- a/src/libstd/json.rs +++ b/src/libstd/json.rs @@ -676,17 +676,6 @@ pure fn lt(value0: Json, value1: Json) -> bool { } } -#[cfg(stage0)] -impl Error : Eq { - pure fn eq(&&other: Error) -> bool { - self.line == other.line && - self.col == other.col && - self.msg == other.msg - } - pure fn ne(&&other: Error) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl Error : Eq { pure fn eq(other: &Error) -> bool { self.line == (*other).line && @@ -696,27 +685,11 @@ impl Error : Eq { pure fn ne(other: &Error) -> bool { !self.eq(other) } } -#[cfg(stage0)] -impl Json : Eq { - pure fn eq(&&other: Json) -> bool { eq(self, other) } - pure fn ne(&&other: Json) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl Json : Eq { pure fn eq(other: &Json) -> bool { eq(self, (*other)) } pure fn ne(other: &Json) -> bool { !self.eq(other) } } -#[cfg(stage0)] -impl Json : Ord { - pure fn lt(&&other: Json) -> bool { lt(self, other) } - pure fn le(&&other: Json) -> bool { !other.lt(self) } - pure fn ge(&&other: Json) -> bool { !self.lt(other) } - pure fn gt(&&other: Json) -> bool { other.lt(self) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl Json : Ord { pure fn lt(other: &Json) -> bool { lt(self, (*other)) } pure fn le(other: &Json) -> bool { !(*other).lt(&self) } diff --git a/src/libstd/list.rs b/src/libstd/list.rs index 26cc7764e7a..45eafb3d018 100644 --- a/src/libstd/list.rs +++ b/src/libstd/list.rs @@ -148,28 +148,6 @@ fn each<T>(l: @List<T>, f: fn(T) -> bool) { } } -#[cfg(stage0)] -impl<T:Eq> List<T> : Eq { - pure fn eq(&&other: List<T>) -> bool { - match self { - Cons(e0a, e1a) => { - match other { - Cons(e0b, e1b) => e0a == e0b && e1a == e1b, - _ => false - } - } - Nil => { - match other { - Nil => true, - _ => false - } - } - } - } - pure fn ne(&&other: List<T>) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl<T:Eq> List<T> : Eq { pure fn eq(other: &List<T>) -> bool { match self { diff --git a/src/libstd/net_url.rs b/src/libstd/net_url.rs index 2545661356f..74c603e29e9 100644 --- a/src/libstd/net_url.rs +++ b/src/libstd/net_url.rs @@ -317,15 +317,6 @@ fn userinfo_to_str(+userinfo: UserInfo) -> ~str { } } -#[cfg(stage0)] -impl UserInfo : Eq { - pure fn eq(&&other: UserInfo) -> bool { - self.user == other.user && self.pass == other.pass - } - pure fn ne(&&other: UserInfo) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl UserInfo : Eq { pure fn eq(other: &UserInfo) -> bool { self.user == (*other).user && self.pass == (*other).pass @@ -386,22 +377,6 @@ enum Input { Unreserved // all other legal characters } -#[cfg(stage0)] -impl Input: Eq { - pure fn eq(&&other: Input) -> bool { - match (self, other) { - (Digit, Digit) => true, - (Hex, Hex) => true, - (Unreserved, Unreserved) => true, - (Digit, _) => false, - (Hex, _) => false, - (Unreserved, _) => false - } - } - pure fn ne(&&other: Input) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl Input : Eq { pure fn eq(other: &Input) -> bool { match (self, (*other)) { @@ -744,24 +719,6 @@ impl Url: to_str::ToStr { } } -#[cfg(stage0)] -impl Url: Eq { - pure fn eq(&&other: Url) -> bool { - self.scheme == other.scheme - && self.user == other.user - && self.host == other.host - && self.port == other.port - && self.path == other.path - && self.query == other.query - && self.fragment == other.fragment - } - - pure fn ne(&&other: Url) -> bool { - !self.eq(other) - } -} -#[cfg(stage1)] -#[cfg(stage2)] impl Url : Eq { pure fn eq(other: &Url) -> bool { self.scheme == (*other).scheme diff --git a/src/libstd/test.rs b/src/libstd/test.rs index a4af0a1772f..51c0ad385ce 100644 --- a/src/libstd/test.rs +++ b/src/libstd/test.rs @@ -96,15 +96,6 @@ fn parse_opts(args: &[~str]) -> OptRes { enum TestResult { TrOk, TrFailed, TrIgnored, } -#[cfg(stage0)] -impl TestResult : Eq { - pure fn eq(&&other: TestResult) -> bool { - (self as uint) == (other as uint) - } - pure fn ne(&&other: TestResult) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl TestResult : Eq { pure fn eq(other: &TestResult) -> bool { (self as uint) == ((*other) as uint) diff --git a/src/libstd/time.rs b/src/libstd/time.rs index bc3f8162c4d..64f65d15a93 100644 --- a/src/libstd/time.rs +++ b/src/libstd/time.rs @@ -37,15 +37,6 @@ extern mod rustrt { /// A record specifying a time value in seconds and nanoseconds. type Timespec = {sec: i64, nsec: i32}; -#[cfg(stage0)] -impl Timespec : Eq { - pure fn eq(&&other: Timespec) -> bool { - self.sec == other.sec && self.nsec == other.nsec - } - pure fn ne(&&other: Timespec) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl Timespec : Eq { pure fn eq(other: &Timespec) -> bool { self.sec == (*other).sec && self.nsec == (*other).nsec @@ -101,26 +92,6 @@ type Tm_ = { tm_nsec: i32, // nanoseconds }; -#[cfg(stage0)] -impl Tm_ : Eq { - pure fn eq(&&other: Tm_) -> bool { - self.tm_sec == other.tm_sec && - self.tm_min == other.tm_min && - self.tm_hour == other.tm_hour && - self.tm_mday == other.tm_mday && - self.tm_mon == other.tm_mon && - self.tm_year == other.tm_year && - self.tm_wday == other.tm_wday && - self.tm_yday == other.tm_yday && - self.tm_isdst == other.tm_isdst && - self.tm_gmtoff == other.tm_gmtoff && - self.tm_zone == other.tm_zone && - self.tm_nsec == other.tm_nsec - } - pure fn ne(&&other: Tm_) -> bool { !self.eq(other) } -} -#[cfg(stage1)] -#[cfg(stage2)] impl Tm_ : Eq { pure fn eq(other: &Tm_) -> bool { self.tm_sec == (*other).tm_sec && @@ -143,13 +114,6 @@ enum Tm { Tm_(Tm_) } -#[cfg(stage0)] -impl Tm : Eq { - pure fn eq(&&other: Tm) -> bool { *self == *other } - pure fn ne(&&other: Tm) -> bool { *self != *other } -} -#[cfg(stage1)] -#[cfg(stage2)] impl Tm : Eq { pure fn eq(other: &Tm) -> bool { *self == *(*other) } pure fn ne(other: &Tm) -> bool { *self != *(*other) } |
