Skip to content

Commit ea49819

Browse files
committed
---
yaml --- r: 21483 b: refs/heads/snap-stage3 c: 5c721bd h: refs/heads/master i: 21481: 3b1d536 21479: bc74d4f v: v3
1 parent 8a48598 commit ea49819

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: e430a699f2c60890d9b86069fd0c68a70ece7120
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 470a3014673d25a9056fddcdea124890dacc41aa
4+
refs/heads/snap-stage3: 5c721bd8108476fb40bf3510002eba8e6eea4c91
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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/snap-stage3/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)