Skip to content

Commit 32f78e8

Browse files
committed
---
yaml --- r: 30191 b: refs/heads/incoming c: 5c721bd h: refs/heads/master i: 30189: 1ecc106 30187: 206967d 30183: 419b497 30175: 06d3eec v: v3
1 parent af0d3cc commit 32f78e8

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
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: 470a3014673d25a9056fddcdea124890dacc41aa
9+
refs/heads/incoming: 5c721bd8108476fb40bf3510002eba8e6eea4c91
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/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/incoming/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)