Skip to content

Commit afd91f8

Browse files
committed
Register snapshots. Remove redundant Eq impls, Makefile hacks
1 parent 2dae768 commit afd91f8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+8
-3677
lines changed

Makefile.in

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -357,16 +357,6 @@ EXTRAFLAGS_STAGE$(1) = $$(RUSTFLAGS_STAGE$(1))
357357

358358
CFGFLAG$(1)_T_$(2)_H_$(3) = stage$(1)
359359

360-
# XXX: Terrible hack. No time to explain! Remove after snapshot.
361-
ifeq ($(1),0)
362-
ifeq ($(3),i686-unknown-linux-gnu)
363-
CFGFLAG$(1)_T_$(2)_H_$(3) = stage1
364-
endif
365-
ifeq ($(3),i686-apple-darwin)
366-
CFGFLAG$(1)_T_$(2)_H_$(3) = stage1
367-
endif
368-
endif
369-
370360
STAGE$(1)_T_$(2)_H_$(3) := \
371361
$$(Q)$$(call CFG_RUN_TARG,$(1), \
372362
$$(CFG_VALGRIND_COMPILE$(1)) \

src/cargo/cargo.rs

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,6 @@ type package = {
2828
versions: ~[(~str, ~str)]
2929
};
3030

31-
#[cfg(stage0)]
32-
impl package : cmp::Ord {
33-
pure fn lt(&&other: package) -> bool {
34-
if self.name.lt(other.name) { return true; }
35-
if other.name.lt(self.name) { return false; }
36-
if self.uuid.lt(other.uuid) { return true; }
37-
if other.uuid.lt(self.uuid) { return false; }
38-
if self.url.lt(other.url) { return true; }
39-
if other.url.lt(self.url) { return false; }
40-
if self.method.lt(other.method) { return true; }
41-
if other.method.lt(self.method) { return false; }
42-
if self.description.lt(other.description) { return true; }
43-
if other.description.lt(self.description) { return false; }
44-
if self.tags.lt(other.tags) { return true; }
45-
if other.tags.lt(self.tags) { return false; }
46-
if self.versions.lt(other.versions) { return true; }
47-
return false;
48-
}
49-
pure fn le(&&other: package) -> bool { !other.lt(self) }
50-
pure fn ge(&&other: package) -> bool { !self.lt(other) }
51-
pure fn gt(&&other: package) -> bool { other.lt(self) }
52-
}
53-
#[cfg(stage1)]
54-
#[cfg(stage2)]
5531
impl package : cmp::Ord {
5632
pure fn lt(other: &package) -> bool {
5733
if self.name.lt(&(*other).name) { return true; }
@@ -123,15 +99,6 @@ type options = {
12399

124100
enum mode { system_mode, user_mode, local_mode }
125101

126-
#[cfg(stage0)]
127-
impl mode : cmp::Eq {
128-
pure fn eq(&&other: mode) -> bool {
129-
(self as uint) == (other as uint)
130-
}
131-
pure fn ne(&&other: mode) -> bool { !self.eq(other) }
132-
}
133-
#[cfg(stage1)]
134-
#[cfg(stage2)]
135102
impl mode : cmp::Eq {
136103
pure fn eq(other: &mode) -> bool {
137104
(self as uint) == ((*other) as uint)

src/compiletest/common.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
enum mode { mode_compile_fail, mode_run_fail, mode_run_pass, mode_pretty, }
22

3-
#[cfg(stage0)]
4-
impl mode : cmp::Eq {
5-
pure fn eq(&&other: mode) -> bool {
6-
other as int == self as int
7-
}
8-
pure fn ne(&&other: mode) -> bool { !self.eq(other) }
9-
}
10-
#[cfg(stage1)]
11-
#[cfg(stage2)]
123
impl mode : cmp::Eq {
134
pure fn eq(other: &mode) -> bool {
145
(*other) as int == self as int

src/fuzzer/fuzzer.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,6 @@ use syntax::diagnostic;
1010
enum test_mode { tm_converge, tm_run, }
1111
type context = { mode: test_mode }; // + rng
1212

13-
#[cfg(stage0)]
14-
impl test_mode : cmp::Eq {
15-
pure fn eq(&&other: test_mode) -> bool {
16-
(self as uint) == (other as uint)
17-
}
18-
pure fn ne(&&other: test_mode) -> bool { !self.eq(other) }
19-
}
20-
#[cfg(stage1)]
21-
#[cfg(stage2)]
2213
impl test_mode : cmp::Eq {
2314
pure fn eq(other: &test_mode) -> bool {
2415
(self as uint) == ((*other) as uint)

src/libcore/at_vec.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,6 @@ pure fn from_elem<T: Copy>(n_elts: uint, t: T) -> @[T] {
139139
#[cfg(notest)]
140140
mod traits {
141141
#[legacy_exports];
142-
#[cfg(stage0)]
143-
impl<T: Copy> @[T]: Add<&[const T],@[T]> {
144-
#[inline(always)]
145-
pure fn add(rhs: &[const T]) -> @[T] {
146-
append(self, rhs)
147-
}
148-
}
149-
#[cfg(stage1)]
150-
#[cfg(stage2)]
151142
impl<T: Copy> @[T] : Add<&[const T],@[T]> {
152143
#[inline(always)]
153144
pure fn add(rhs: & &[const T]) -> @[T] {

src/libcore/bool.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,6 @@ fn all_values(blk: fn(v: bool)) {
6969
/// converts truth value to an 8 bit byte
7070
pure fn to_bit(v: bool) -> u8 { if v { 1u8 } else { 0u8 } }
7171

72-
#[cfg(stage0)]
73-
impl bool : cmp::Eq {
74-
pure fn eq(&&other: bool) -> bool { self == other }
75-
pure fn ne(&&other: bool) -> bool { self != other }
76-
}
77-
#[cfg(stage1)]
78-
#[cfg(stage2)]
7972
impl bool : cmp::Eq {
8073
pure fn eq(other: &bool) -> bool { self == (*other) }
8174
pure fn ne(other: &bool) -> bool { self != (*other) }

src/libcore/box.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,11 @@ pure fn ptr_eq<T>(a: @T, b: @T) -> bool {
3131
unsafe { ptr::addr_of(*a) == ptr::addr_of(*b) }
3232
}
3333

34-
#[cfg(stage0)]
35-
impl<T:Eq> @const T : Eq {
36-
pure fn eq(&&other: @const T) -> bool { *self == *other }
37-
pure fn ne(&&other: @const T) -> bool { *self != *other }
38-
}
39-
#[cfg(stage1)]
40-
#[cfg(stage2)]
4134
impl<T:Eq> @const T : Eq {
4235
pure fn eq(other: &@const T) -> bool { *self == *(*other) }
4336
pure fn ne(other: &@const T) -> bool { *self != *(*other) }
4437
}
4538

46-
#[cfg(stage0)]
47-
impl<T:Ord> @const T : Ord {
48-
pure fn lt(&&other: @const T) -> bool { *self < *other }
49-
pure fn le(&&other: @const T) -> bool { *self <= *other }
50-
pure fn ge(&&other: @const T) -> bool { *self >= *other }
51-
pure fn gt(&&other: @const T) -> bool { *self > *other }
52-
}
53-
#[cfg(stage1)]
54-
#[cfg(stage2)]
5539
impl<T:Ord> @const T : Ord {
5640
pure fn lt(other: &@const T) -> bool { *self < *(*other) }
5741
pure fn le(other: &@const T) -> bool { *self <= *(*other) }

src/libcore/char.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,6 @@ pure fn cmp(a: char, b: char) -> int {
185185
else { 0 }
186186
}
187187

188-
#[cfg(stage0)]
189-
impl char: Eq {
190-
pure fn eq(&&other: char) -> bool { self == other }
191-
pure fn ne(&&other: char) -> bool { self != other }
192-
}
193-
#[cfg(stage1)]
194-
#[cfg(stage2)]
195188
impl char : Eq {
196189
pure fn eq(other: &char) -> bool { self == (*other) }
197190
pure fn ne(other: &char) -> bool { self != (*other) }

src/libcore/cmp.rs

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,6 @@ mod nounittest {
3232
* an `le` method, with the others generated from
3333
* default implementations.
3434
*/
35-
#[cfg(stage0)]
36-
#[lang="ord"]
37-
trait Ord {
38-
pure fn lt(&&other: self) -> bool;
39-
pure fn le(&&other: self) -> bool;
40-
pure fn ge(&&other: self) -> bool;
41-
pure fn gt(&&other: self) -> bool;
42-
}
43-
44-
#[cfg(stage1)]
45-
#[cfg(stage2)]
4635
#[lang="ord"]
4736
trait Ord {
4837
pure fn lt(other: &self) -> bool;
@@ -51,7 +40,6 @@ mod nounittest {
5140
pure fn gt(other: &self) -> bool;
5241
}
5342

54-
#[cfg(stage0)]
5543
#[lang="eq"]
5644
/**
5745
* Trait for values that can be compared for equality
@@ -61,13 +49,6 @@ mod nounittest {
6149
* an `eq` method, with the other generated from
6250
* a default implementation.
6351
*/
64-
trait Eq {
65-
pure fn eq(&&other: self) -> bool;
66-
pure fn ne(&&other: self) -> bool;
67-
}
68-
69-
#[cfg(stage1)]
70-
#[cfg(stage2)]
7152
#[lang="eq"]
7253
trait Eq {
7354
pure fn eq(other: &self) -> bool;
@@ -82,31 +63,13 @@ mod nounittest {
8263
#[cfg(test)]
8364
mod unittest {
8465
#[legacy_exports];
85-
#[cfg(stage0)]
86-
trait Ord {
87-
pure fn lt(&&other: self) -> bool;
88-
pure fn le(&&other: self) -> bool;
89-
pure fn ge(&&other: self) -> bool;
90-
pure fn gt(&&other: self) -> bool;
91-
}
92-
93-
#[cfg(stage1)]
94-
#[cfg(stage2)]
9566
trait Ord {
9667
pure fn lt(other: &self) -> bool;
9768
pure fn le(other: &self) -> bool;
9869
pure fn ge(other: &self) -> bool;
9970
pure fn gt(other: &self) -> bool;
10071
}
10172

102-
#[cfg(stage0)]
103-
trait Eq {
104-
pure fn eq(&&other: self) -> bool;
105-
pure fn ne(&&other: self) -> bool;
106-
}
107-
108-
#[cfg(stage1)]
109-
#[cfg(stage2)]
11073
trait Eq {
11174
pure fn eq(other: &self) -> bool;
11275
pure fn ne(other: &self) -> bool;
@@ -117,68 +80,26 @@ mod unittest {
11780
mod unittest {
11881
#[legacy_exports];}
11982

120-
#[cfg(stage0)]
121-
pure fn lt<T: Ord>(v1: &T, v2: &T) -> bool {
122-
v1.lt(v2)
123-
}
124-
125-
#[cfg(stage0)]
126-
pure fn le<T: Ord Eq>(v1: &T, v2: &T) -> bool {
127-
v1.lt(v2) || v1.eq(v2)
128-
}
129-
130-
#[cfg(stage0)]
131-
pure fn eq<T: Eq>(v1: &T, v2: &T) -> bool {
132-
v1.eq(v2)
133-
}
134-
135-
#[cfg(stage0)]
136-
pure fn ne<T: Eq>(v1: &T, v2: &T) -> bool {
137-
v1.ne(v2)
138-
}
139-
140-
#[cfg(stage0)]
141-
pure fn ge<T: Ord>(v1: &T, v2: &T) -> bool {
142-
v1.ge(v2)
143-
}
144-
145-
#[cfg(stage0)]
146-
pure fn gt<T: Ord>(v1: &T, v2: &T) -> bool {
147-
v1.gt(v2)
148-
}
149-
150-
#[cfg(stage1)]
151-
#[cfg(stage2)]
15283
pure fn lt<T: Ord>(v1: &T, v2: &T) -> bool {
15384
(*v1).lt(v2)
15485
}
15586

156-
#[cfg(stage1)]
157-
#[cfg(stage2)]
15887
pure fn le<T: Ord Eq>(v1: &T, v2: &T) -> bool {
15988
(*v1).lt(v2) || (*v1).eq(v2)
16089
}
16190

162-
#[cfg(stage1)]
163-
#[cfg(stage2)]
16491
pure fn eq<T: Eq>(v1: &T, v2: &T) -> bool {
16592
(*v1).eq(v2)
16693
}
16794

168-
#[cfg(stage1)]
169-
#[cfg(stage2)]
17095
pure fn ne<T: Eq>(v1: &T, v2: &T) -> bool {
17196
(*v1).ne(v2)
17297
}
17398

174-
#[cfg(stage1)]
175-
#[cfg(stage2)]
17699
pure fn ge<T: Ord>(v1: &T, v2: &T) -> bool {
177100
(*v1).ge(v2)
178101
}
179102

180-
#[cfg(stage1)]
181-
#[cfg(stage2)]
182103
pure fn gt<T: Ord>(v1: &T, v2: &T) -> bool {
183104
(*v1).gt(v2)
184105
}

src/libcore/either.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -126,28 +126,6 @@ pure fn unwrap_right<T,U>(+eith: Either<T,U>) -> U {
126126
}
127127
}
128128

129-
#[cfg(stage0)]
130-
impl<T:Eq,U:Eq> Either<T,U> : Eq {
131-
pure fn eq(&&other: Either<T,U>) -> bool {
132-
match self {
133-
Left(a) => {
134-
match other {
135-
Left(b) => a.eq(b),
136-
Right(_) => false
137-
}
138-
}
139-
Right(a) => {
140-
match other {
141-
Left(_) => false,
142-
Right(b) => a.eq(b)
143-
}
144-
}
145-
}
146-
}
147-
pure fn ne(&&other: Either<T,U>) -> bool { !self.eq(other) }
148-
}
149-
#[cfg(stage1)]
150-
#[cfg(stage2)]
151129
impl<T:Eq,U:Eq> Either<T,U> : Eq {
152130
pure fn eq(other: &Either<T,U>) -> bool {
153131
match self {

src/libcore/extfmt.rs

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -388,24 +388,6 @@ mod rt {
388388

389389
enum PadMode { PadSigned, PadUnsigned, PadNozero, PadFloat }
390390

391-
#[cfg(stage0)]
392-
impl PadMode: Eq {
393-
pure fn eq(&&other: PadMode) -> bool {
394-
match (self, other) {
395-
(PadSigned, PadSigned) => true,
396-
(PadUnsigned, PadUnsigned) => true,
397-
(PadNozero, PadNozero) => true,
398-
(PadFloat, PadFloat) => true,
399-
(PadSigned, _) => false,
400-
(PadUnsigned, _) => false,
401-
(PadNozero, _) => false,
402-
(PadFloat, _) => false
403-
}
404-
}
405-
pure fn ne(&&other: PadMode) -> bool { !self.eq(other) }
406-
}
407-
#[cfg(stage1)]
408-
#[cfg(stage2)]
409391
impl PadMode : Eq {
410392
pure fn eq(other: &PadMode) -> bool {
411393
match (self, (*other)) {
@@ -595,24 +577,6 @@ mod rt2 {
595577

596578
enum PadMode { PadSigned, PadUnsigned, PadNozero, PadFloat }
597579

598-
#[cfg(stage0)]
599-
impl PadMode: Eq {
600-
pure fn eq(&&other: PadMode) -> bool {
601-
match (self, other) {
602-
(PadSigned, PadSigned) => true,
603-
(PadUnsigned, PadUnsigned) => true,
604-
(PadNozero, PadNozero) => true,
605-
(PadFloat, PadFloat) => true,
606-
(PadSigned, _) => false,
607-
(PadUnsigned, _) => false,
608-
(PadNozero, _) => false,
609-
(PadFloat, _) => false
610-
}
611-
}
612-
pure fn ne(&&other: PadMode) -> bool { !self.eq(other) }
613-
}
614-
#[cfg(stage1)]
615-
#[cfg(stage2)]
616580
impl PadMode : Eq {
617581
pure fn eq(other: &PadMode) -> bool {
618582
match (self, (*other)) {

0 commit comments

Comments
 (0)