Skip to content

Commit 73c27c4

Browse files
committed
---
yaml --- r: 32253 b: refs/heads/dist-snap c: 5c721bd h: refs/heads/master i: 32251: 80af738 v: v3
1 parent 5c0a875 commit 73c27c4

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: 470a3014673d25a9056fddcdea124890dacc41aa
10+
refs/heads/dist-snap: 5c721bd8108476fb40bf3510002eba8e6eea4c91
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/src/libcore/util.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#[forbid(deprecated_mode)];
33
#[forbid(deprecated_pattern)];
44

5+
use cmp::Eq;
6+
57
/**
68
* Miscellaneous helpers for common patterns.
79
*/
@@ -62,7 +64,7 @@ mod tests {
6264
fn identity_crisis() {
6365
// Writing a test for the identity function. How did it come to this?
6466
let x = ~[(5, false)];
65-
assert x == id(copy x);
67+
assert x.eq(id(copy x));
6668
}
6769
#[test]
6870
fn test_swap() {

branches/dist-snap/src/libstd/time.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,33 @@ type Tm_ = {
9090
tm_nsec: i32, // nanoseconds
9191
};
9292

93+
impl Tm_ : Eq {
94+
pure fn eq(&&other: Tm_) -> bool {
95+
self.tm_sec == other.tm_sec &&
96+
self.tm_min == other.tm_min &&
97+
self.tm_hour == other.tm_hour &&
98+
self.tm_mday == other.tm_mday &&
99+
self.tm_mon == other.tm_mon &&
100+
self.tm_year == other.tm_year &&
101+
self.tm_wday == other.tm_wday &&
102+
self.tm_yday == other.tm_yday &&
103+
self.tm_isdst == other.tm_isdst &&
104+
self.tm_gmtoff == other.tm_gmtoff &&
105+
self.tm_zone == other.tm_zone &&
106+
self.tm_nsec == other.tm_nsec
107+
}
108+
}
109+
93110
enum Tm {
94111
Tm_(Tm_)
95112
}
96113

114+
impl Tm : Eq {
115+
pure fn eq(&&other: Tm) -> bool {
116+
*self == *other
117+
}
118+
}
119+
97120
fn empty_tm() -> Tm {
98121
Tm_({
99122
tm_sec: 0_i32,

0 commit comments

Comments
 (0)