mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
Register snapshots. Remove redundant Eq impls, Makefile hacks
This commit is contained in:
parent
2dae768624
commit
afd91f8a56
10
Makefile.in
10
Makefile.in
@ -357,16 +357,6 @@ EXTRAFLAGS_STAGE$(1) = $$(RUSTFLAGS_STAGE$(1))
|
|||||||
|
|
||||||
CFGFLAG$(1)_T_$(2)_H_$(3) = stage$(1)
|
CFGFLAG$(1)_T_$(2)_H_$(3) = stage$(1)
|
||||||
|
|
||||||
# XXX: Terrible hack. No time to explain! Remove after snapshot.
|
|
||||||
ifeq ($(1),0)
|
|
||||||
ifeq ($(3),i686-unknown-linux-gnu)
|
|
||||||
CFGFLAG$(1)_T_$(2)_H_$(3) = stage1
|
|
||||||
endif
|
|
||||||
ifeq ($(3),i686-apple-darwin)
|
|
||||||
CFGFLAG$(1)_T_$(2)_H_$(3) = stage1
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
STAGE$(1)_T_$(2)_H_$(3) := \
|
STAGE$(1)_T_$(2)_H_$(3) := \
|
||||||
$$(Q)$$(call CFG_RUN_TARG,$(1), \
|
$$(Q)$$(call CFG_RUN_TARG,$(1), \
|
||||||
$$(CFG_VALGRIND_COMPILE$(1)) \
|
$$(CFG_VALGRIND_COMPILE$(1)) \
|
||||||
|
@ -28,30 +28,6 @@ type package = {
|
|||||||
versions: ~[(~str, ~str)]
|
versions: ~[(~str, ~str)]
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl package : cmp::Ord {
|
|
||||||
pure fn lt(&&other: package) -> bool {
|
|
||||||
if self.name.lt(other.name) { return true; }
|
|
||||||
if other.name.lt(self.name) { return false; }
|
|
||||||
if self.uuid.lt(other.uuid) { return true; }
|
|
||||||
if other.uuid.lt(self.uuid) { return false; }
|
|
||||||
if self.url.lt(other.url) { return true; }
|
|
||||||
if other.url.lt(self.url) { return false; }
|
|
||||||
if self.method.lt(other.method) { return true; }
|
|
||||||
if other.method.lt(self.method) { return false; }
|
|
||||||
if self.description.lt(other.description) { return true; }
|
|
||||||
if other.description.lt(self.description) { return false; }
|
|
||||||
if self.tags.lt(other.tags) { return true; }
|
|
||||||
if other.tags.lt(self.tags) { return false; }
|
|
||||||
if self.versions.lt(other.versions) { return true; }
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
pure fn le(&&other: package) -> bool { !other.lt(self) }
|
|
||||||
pure fn ge(&&other: package) -> bool { !self.lt(other) }
|
|
||||||
pure fn gt(&&other: package) -> bool { other.lt(self) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl package : cmp::Ord {
|
impl package : cmp::Ord {
|
||||||
pure fn lt(other: &package) -> bool {
|
pure fn lt(other: &package) -> bool {
|
||||||
if self.name.lt(&(*other).name) { return true; }
|
if self.name.lt(&(*other).name) { return true; }
|
||||||
@ -123,15 +99,6 @@ type options = {
|
|||||||
|
|
||||||
enum mode { system_mode, user_mode, local_mode }
|
enum mode { system_mode, user_mode, local_mode }
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl mode : cmp::Eq {
|
|
||||||
pure fn eq(&&other: mode) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: mode) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl mode : cmp::Eq {
|
impl mode : cmp::Eq {
|
||||||
pure fn eq(other: &mode) -> bool {
|
pure fn eq(other: &mode) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
|
@ -1,14 +1,5 @@
|
|||||||
enum mode { mode_compile_fail, mode_run_fail, mode_run_pass, mode_pretty, }
|
enum mode { mode_compile_fail, mode_run_fail, mode_run_pass, mode_pretty, }
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl mode : cmp::Eq {
|
|
||||||
pure fn eq(&&other: mode) -> bool {
|
|
||||||
other as int == self as int
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: mode) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl mode : cmp::Eq {
|
impl mode : cmp::Eq {
|
||||||
pure fn eq(other: &mode) -> bool {
|
pure fn eq(other: &mode) -> bool {
|
||||||
(*other) as int == self as int
|
(*other) as int == self as int
|
||||||
|
@ -10,15 +10,6 @@ use syntax::diagnostic;
|
|||||||
enum test_mode { tm_converge, tm_run, }
|
enum test_mode { tm_converge, tm_run, }
|
||||||
type context = { mode: test_mode }; // + rng
|
type context = { mode: test_mode }; // + rng
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl test_mode : cmp::Eq {
|
|
||||||
pure fn eq(&&other: test_mode) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: test_mode) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl test_mode : cmp::Eq {
|
impl test_mode : cmp::Eq {
|
||||||
pure fn eq(other: &test_mode) -> bool {
|
pure fn eq(other: &test_mode) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
|
@ -139,15 +139,6 @@ pure fn from_elem<T: Copy>(n_elts: uint, t: T) -> @[T] {
|
|||||||
#[cfg(notest)]
|
#[cfg(notest)]
|
||||||
mod traits {
|
mod traits {
|
||||||
#[legacy_exports];
|
#[legacy_exports];
|
||||||
#[cfg(stage0)]
|
|
||||||
impl<T: Copy> @[T]: Add<&[const T],@[T]> {
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn add(rhs: &[const T]) -> @[T] {
|
|
||||||
append(self, rhs)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl<T: Copy> @[T] : Add<&[const T],@[T]> {
|
impl<T: Copy> @[T] : Add<&[const T],@[T]> {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pure fn add(rhs: & &[const T]) -> @[T] {
|
pure fn add(rhs: & &[const T]) -> @[T] {
|
||||||
|
@ -69,13 +69,6 @@ fn all_values(blk: fn(v: bool)) {
|
|||||||
/// converts truth value to an 8 bit byte
|
/// converts truth value to an 8 bit byte
|
||||||
pure fn to_bit(v: bool) -> u8 { if v { 1u8 } else { 0u8 } }
|
pure fn to_bit(v: bool) -> u8 { if v { 1u8 } else { 0u8 } }
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl bool : cmp::Eq {
|
|
||||||
pure fn eq(&&other: bool) -> bool { self == other }
|
|
||||||
pure fn ne(&&other: bool) -> bool { self != other }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl bool : cmp::Eq {
|
impl bool : cmp::Eq {
|
||||||
pure fn eq(other: &bool) -> bool { self == (*other) }
|
pure fn eq(other: &bool) -> bool { self == (*other) }
|
||||||
pure fn ne(other: &bool) -> bool { self != (*other) }
|
pure fn ne(other: &bool) -> bool { self != (*other) }
|
||||||
|
@ -31,27 +31,11 @@ pure fn ptr_eq<T>(a: @T, b: @T) -> bool {
|
|||||||
unsafe { ptr::addr_of(*a) == ptr::addr_of(*b) }
|
unsafe { ptr::addr_of(*a) == ptr::addr_of(*b) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl<T:Eq> @const T : Eq {
|
|
||||||
pure fn eq(&&other: @const T) -> bool { *self == *other }
|
|
||||||
pure fn ne(&&other: @const T) -> bool { *self != *other }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl<T:Eq> @const T : Eq {
|
impl<T:Eq> @const T : Eq {
|
||||||
pure fn eq(other: &@const T) -> bool { *self == *(*other) }
|
pure fn eq(other: &@const T) -> bool { *self == *(*other) }
|
||||||
pure fn ne(other: &@const T) -> bool { *self != *(*other) }
|
pure fn ne(other: &@const T) -> bool { *self != *(*other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl<T:Ord> @const T : Ord {
|
|
||||||
pure fn lt(&&other: @const T) -> bool { *self < *other }
|
|
||||||
pure fn le(&&other: @const T) -> bool { *self <= *other }
|
|
||||||
pure fn ge(&&other: @const T) -> bool { *self >= *other }
|
|
||||||
pure fn gt(&&other: @const T) -> bool { *self > *other }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl<T:Ord> @const T : Ord {
|
impl<T:Ord> @const T : Ord {
|
||||||
pure fn lt(other: &@const T) -> bool { *self < *(*other) }
|
pure fn lt(other: &@const T) -> bool { *self < *(*other) }
|
||||||
pure fn le(other: &@const T) -> bool { *self <= *(*other) }
|
pure fn le(other: &@const T) -> bool { *self <= *(*other) }
|
||||||
|
@ -185,13 +185,6 @@ pure fn cmp(a: char, b: char) -> int {
|
|||||||
else { 0 }
|
else { 0 }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl char: Eq {
|
|
||||||
pure fn eq(&&other: char) -> bool { self == other }
|
|
||||||
pure fn ne(&&other: char) -> bool { self != other }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl char : Eq {
|
impl char : Eq {
|
||||||
pure fn eq(other: &char) -> bool { self == (*other) }
|
pure fn eq(other: &char) -> bool { self == (*other) }
|
||||||
pure fn ne(other: &char) -> bool { self != (*other) }
|
pure fn ne(other: &char) -> bool { self != (*other) }
|
||||||
|
@ -32,17 +32,6 @@ mod nounittest {
|
|||||||
* an `le` method, with the others generated from
|
* an `le` method, with the others generated from
|
||||||
* default implementations.
|
* default implementations.
|
||||||
*/
|
*/
|
||||||
#[cfg(stage0)]
|
|
||||||
#[lang="ord"]
|
|
||||||
trait Ord {
|
|
||||||
pure fn lt(&&other: self) -> bool;
|
|
||||||
pure fn le(&&other: self) -> bool;
|
|
||||||
pure fn ge(&&other: self) -> bool;
|
|
||||||
pure fn gt(&&other: self) -> bool;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
#[lang="ord"]
|
#[lang="ord"]
|
||||||
trait Ord {
|
trait Ord {
|
||||||
pure fn lt(other: &self) -> bool;
|
pure fn lt(other: &self) -> bool;
|
||||||
@ -51,7 +40,6 @@ mod nounittest {
|
|||||||
pure fn gt(other: &self) -> bool;
|
pure fn gt(other: &self) -> bool;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
#[lang="eq"]
|
#[lang="eq"]
|
||||||
/**
|
/**
|
||||||
* Trait for values that can be compared for equality
|
* Trait for values that can be compared for equality
|
||||||
@ -61,13 +49,6 @@ mod nounittest {
|
|||||||
* an `eq` method, with the other generated from
|
* an `eq` method, with the other generated from
|
||||||
* a default implementation.
|
* a default implementation.
|
||||||
*/
|
*/
|
||||||
trait Eq {
|
|
||||||
pure fn eq(&&other: self) -> bool;
|
|
||||||
pure fn ne(&&other: self) -> bool;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
#[lang="eq"]
|
#[lang="eq"]
|
||||||
trait Eq {
|
trait Eq {
|
||||||
pure fn eq(other: &self) -> bool;
|
pure fn eq(other: &self) -> bool;
|
||||||
@ -82,16 +63,6 @@ mod nounittest {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod unittest {
|
mod unittest {
|
||||||
#[legacy_exports];
|
#[legacy_exports];
|
||||||
#[cfg(stage0)]
|
|
||||||
trait Ord {
|
|
||||||
pure fn lt(&&other: self) -> bool;
|
|
||||||
pure fn le(&&other: self) -> bool;
|
|
||||||
pure fn ge(&&other: self) -> bool;
|
|
||||||
pure fn gt(&&other: self) -> bool;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
trait Ord {
|
trait Ord {
|
||||||
pure fn lt(other: &self) -> bool;
|
pure fn lt(other: &self) -> bool;
|
||||||
pure fn le(other: &self) -> bool;
|
pure fn le(other: &self) -> bool;
|
||||||
@ -99,14 +70,6 @@ mod unittest {
|
|||||||
pure fn gt(other: &self) -> bool;
|
pure fn gt(other: &self) -> bool;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
trait Eq {
|
|
||||||
pure fn eq(&&other: self) -> bool;
|
|
||||||
pure fn ne(&&other: self) -> bool;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
trait Eq {
|
trait Eq {
|
||||||
pure fn eq(other: &self) -> bool;
|
pure fn eq(other: &self) -> bool;
|
||||||
pure fn ne(other: &self) -> bool;
|
pure fn ne(other: &self) -> bool;
|
||||||
@ -117,68 +80,26 @@ mod unittest {
|
|||||||
mod unittest {
|
mod unittest {
|
||||||
#[legacy_exports];}
|
#[legacy_exports];}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
pure fn lt<T: Ord>(v1: &T, v2: &T) -> bool {
|
|
||||||
v1.lt(v2)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
pure fn le<T: Ord Eq>(v1: &T, v2: &T) -> bool {
|
|
||||||
v1.lt(v2) || v1.eq(v2)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
pure fn eq<T: Eq>(v1: &T, v2: &T) -> bool {
|
|
||||||
v1.eq(v2)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
pure fn ne<T: Eq>(v1: &T, v2: &T) -> bool {
|
|
||||||
v1.ne(v2)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
pure fn ge<T: Ord>(v1: &T, v2: &T) -> bool {
|
|
||||||
v1.ge(v2)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
pure fn gt<T: Ord>(v1: &T, v2: &T) -> bool {
|
|
||||||
v1.gt(v2)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
pure fn lt<T: Ord>(v1: &T, v2: &T) -> bool {
|
pure fn lt<T: Ord>(v1: &T, v2: &T) -> bool {
|
||||||
(*v1).lt(v2)
|
(*v1).lt(v2)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
pure fn le<T: Ord Eq>(v1: &T, v2: &T) -> bool {
|
pure fn le<T: Ord Eq>(v1: &T, v2: &T) -> bool {
|
||||||
(*v1).lt(v2) || (*v1).eq(v2)
|
(*v1).lt(v2) || (*v1).eq(v2)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
pure fn eq<T: Eq>(v1: &T, v2: &T) -> bool {
|
pure fn eq<T: Eq>(v1: &T, v2: &T) -> bool {
|
||||||
(*v1).eq(v2)
|
(*v1).eq(v2)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
pure fn ne<T: Eq>(v1: &T, v2: &T) -> bool {
|
pure fn ne<T: Eq>(v1: &T, v2: &T) -> bool {
|
||||||
(*v1).ne(v2)
|
(*v1).ne(v2)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
pure fn ge<T: Ord>(v1: &T, v2: &T) -> bool {
|
pure fn ge<T: Ord>(v1: &T, v2: &T) -> bool {
|
||||||
(*v1).ge(v2)
|
(*v1).ge(v2)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
pure fn gt<T: Ord>(v1: &T, v2: &T) -> bool {
|
pure fn gt<T: Ord>(v1: &T, v2: &T) -> bool {
|
||||||
(*v1).gt(v2)
|
(*v1).gt(v2)
|
||||||
}
|
}
|
||||||
|
@ -126,28 +126,6 @@ pure fn unwrap_right<T,U>(+eith: Either<T,U>) -> U {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl<T:Eq,U:Eq> Either<T,U> : Eq {
|
|
||||||
pure fn eq(&&other: Either<T,U>) -> bool {
|
|
||||||
match self {
|
|
||||||
Left(a) => {
|
|
||||||
match other {
|
|
||||||
Left(b) => a.eq(b),
|
|
||||||
Right(_) => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Right(a) => {
|
|
||||||
match other {
|
|
||||||
Left(_) => false,
|
|
||||||
Right(b) => a.eq(b)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: Either<T,U>) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl<T:Eq,U:Eq> Either<T,U> : Eq {
|
impl<T:Eq,U:Eq> Either<T,U> : Eq {
|
||||||
pure fn eq(other: &Either<T,U>) -> bool {
|
pure fn eq(other: &Either<T,U>) -> bool {
|
||||||
match self {
|
match self {
|
||||||
|
@ -388,24 +388,6 @@ mod rt {
|
|||||||
|
|
||||||
enum PadMode { PadSigned, PadUnsigned, PadNozero, PadFloat }
|
enum PadMode { PadSigned, PadUnsigned, PadNozero, PadFloat }
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl PadMode: Eq {
|
|
||||||
pure fn eq(&&other: PadMode) -> bool {
|
|
||||||
match (self, other) {
|
|
||||||
(PadSigned, PadSigned) => true,
|
|
||||||
(PadUnsigned, PadUnsigned) => true,
|
|
||||||
(PadNozero, PadNozero) => true,
|
|
||||||
(PadFloat, PadFloat) => true,
|
|
||||||
(PadSigned, _) => false,
|
|
||||||
(PadUnsigned, _) => false,
|
|
||||||
(PadNozero, _) => false,
|
|
||||||
(PadFloat, _) => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: PadMode) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl PadMode : Eq {
|
impl PadMode : Eq {
|
||||||
pure fn eq(other: &PadMode) -> bool {
|
pure fn eq(other: &PadMode) -> bool {
|
||||||
match (self, (*other)) {
|
match (self, (*other)) {
|
||||||
@ -595,24 +577,6 @@ mod rt2 {
|
|||||||
|
|
||||||
enum PadMode { PadSigned, PadUnsigned, PadNozero, PadFloat }
|
enum PadMode { PadSigned, PadUnsigned, PadNozero, PadFloat }
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl PadMode: Eq {
|
|
||||||
pure fn eq(&&other: PadMode) -> bool {
|
|
||||||
match (self, other) {
|
|
||||||
(PadSigned, PadSigned) => true,
|
|
||||||
(PadUnsigned, PadUnsigned) => true,
|
|
||||||
(PadNozero, PadNozero) => true,
|
|
||||||
(PadFloat, PadFloat) => true,
|
|
||||||
(PadSigned, _) => false,
|
|
||||||
(PadUnsigned, _) => false,
|
|
||||||
(PadNozero, _) => false,
|
|
||||||
(PadFloat, _) => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: PadMode) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl PadMode : Eq {
|
impl PadMode : Eq {
|
||||||
pure fn eq(other: &PadMode) -> bool {
|
pure fn eq(other: &PadMode) -> bool {
|
||||||
match (self, (*other)) {
|
match (self, (*other)) {
|
||||||
|
@ -415,27 +415,11 @@ pure fn sin(x: float) -> float { f64::sin(x as f64) as float }
|
|||||||
pure fn cos(x: float) -> float { f64::cos(x as f64) as float }
|
pure fn cos(x: float) -> float { f64::cos(x as f64) as float }
|
||||||
pure fn tan(x: float) -> float { f64::tan(x as f64) as float }
|
pure fn tan(x: float) -> float { f64::tan(x as f64) as float }
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl float: Eq {
|
|
||||||
pure fn eq(&&other: float) -> bool { self == other }
|
|
||||||
pure fn ne(&&other: float) -> bool { self != other }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl float : Eq {
|
impl float : Eq {
|
||||||
pure fn eq(other: &float) -> bool { self == (*other) }
|
pure fn eq(other: &float) -> bool { self == (*other) }
|
||||||
pure fn ne(other: &float) -> bool { self != (*other) }
|
pure fn ne(other: &float) -> bool { self != (*other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl float: Ord {
|
|
||||||
pure fn lt(&&other: float) -> bool { self < other }
|
|
||||||
pure fn le(&&other: float) -> bool { self <= other }
|
|
||||||
pure fn ge(&&other: float) -> bool { self >= other }
|
|
||||||
pure fn gt(&&other: float) -> bool { self > other }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl float : Ord {
|
impl float : Ord {
|
||||||
pure fn lt(other: &float) -> bool { self < (*other) }
|
pure fn lt(other: &float) -> bool { self < (*other) }
|
||||||
pure fn le(other: &float) -> bool { self <= (*other) }
|
pure fn le(other: &float) -> bool { self <= (*other) }
|
||||||
|
@ -68,15 +68,6 @@ pure fn abs(i: T) -> T {
|
|||||||
if is_negative(i) { -i } else { i }
|
if is_negative(i) { -i } else { i }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl T: Ord {
|
|
||||||
pure fn lt(&&other: T) -> bool { return self < other; }
|
|
||||||
pure fn le(&&other: T) -> bool { return self <= other; }
|
|
||||||
pure fn ge(&&other: T) -> bool { return self >= other; }
|
|
||||||
pure fn gt(&&other: T) -> bool { return self > other; }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl T : Ord {
|
impl T : Ord {
|
||||||
pure fn lt(other: &T) -> bool { return self < (*other); }
|
pure fn lt(other: &T) -> bool { return self < (*other); }
|
||||||
pure fn le(other: &T) -> bool { return self <= (*other); }
|
pure fn le(other: &T) -> bool { return self <= (*other); }
|
||||||
@ -84,13 +75,6 @@ impl T : Ord {
|
|||||||
pure fn gt(other: &T) -> bool { return self > (*other); }
|
pure fn gt(other: &T) -> bool { return self > (*other); }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl T: Eq {
|
|
||||||
pure fn eq(&&other: T) -> bool { return self == other; }
|
|
||||||
pure fn ne(&&other: T) -> bool { return self != other; }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl T : Eq {
|
impl T : Eq {
|
||||||
pure fn eq(other: &T) -> bool { return self == (*other); }
|
pure fn eq(other: &T) -> bool { return self == (*other); }
|
||||||
pure fn ne(other: &T) -> bool { return self != (*other); }
|
pure fn ne(other: &T) -> bool { return self != (*other); }
|
||||||
|
@ -329,18 +329,6 @@ enum FileFlag { Append, Create, Truncate, NoFlag, }
|
|||||||
// What type of writer are we?
|
// What type of writer are we?
|
||||||
enum WriterType { Screen, File }
|
enum WriterType { Screen, File }
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl WriterType: Eq {
|
|
||||||
pure fn eq(&&other: WriterType) -> bool {
|
|
||||||
match (self, other) {
|
|
||||||
(Screen, Screen) | (File, File) => true,
|
|
||||||
(Screen, _) | (File, _) => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: WriterType) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl WriterType : Eq {
|
impl WriterType : Eq {
|
||||||
pure fn eq(other: &WriterType) -> bool {
|
pure fn eq(other: &WriterType) -> bool {
|
||||||
match (self, (*other)) {
|
match (self, (*other)) {
|
||||||
|
@ -20,66 +20,26 @@ trait Owned {
|
|||||||
// Empty.
|
// Empty.
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
#[lang="add"]
|
|
||||||
trait Add<RHS,Result> {
|
|
||||||
pure fn add(rhs: RHS) -> Result;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
#[lang="add"]
|
#[lang="add"]
|
||||||
trait Add<RHS,Result> {
|
trait Add<RHS,Result> {
|
||||||
pure fn add(rhs: &RHS) -> Result;
|
pure fn add(rhs: &RHS) -> Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
#[lang="sub"]
|
|
||||||
trait Sub<RHS,Result> {
|
|
||||||
pure fn sub(rhs: RHS) -> Result;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
#[lang="sub"]
|
#[lang="sub"]
|
||||||
trait Sub<RHS,Result> {
|
trait Sub<RHS,Result> {
|
||||||
pure fn sub(rhs: &RHS) -> Result;
|
pure fn sub(rhs: &RHS) -> Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
#[lang="mul"]
|
|
||||||
trait Mul<RHS,Result> {
|
|
||||||
pure fn mul(rhs: RHS) -> Result;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
#[lang="mul"]
|
#[lang="mul"]
|
||||||
trait Mul<RHS,Result> {
|
trait Mul<RHS,Result> {
|
||||||
pure fn mul(rhs: &RHS) -> Result;
|
pure fn mul(rhs: &RHS) -> Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
#[lang="div"]
|
|
||||||
trait Div<RHS,Result> {
|
|
||||||
pure fn div(rhs: RHS) -> Result;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
#[lang="div"]
|
#[lang="div"]
|
||||||
trait Div<RHS,Result> {
|
trait Div<RHS,Result> {
|
||||||
pure fn div(rhs: &RHS) -> Result;
|
pure fn div(rhs: &RHS) -> Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
#[lang="modulo"]
|
|
||||||
trait Modulo<RHS,Result> {
|
|
||||||
pure fn modulo(rhs: RHS) -> Result;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
#[lang="modulo"]
|
#[lang="modulo"]
|
||||||
trait Modulo<RHS,Result> {
|
trait Modulo<RHS,Result> {
|
||||||
pure fn modulo(rhs: &RHS) -> Result;
|
pure fn modulo(rhs: &RHS) -> Result;
|
||||||
@ -90,66 +50,26 @@ trait Neg<Result> {
|
|||||||
pure fn neg() -> Result;
|
pure fn neg() -> Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
#[lang="bitand"]
|
|
||||||
trait BitAnd<RHS,Result> {
|
|
||||||
pure fn bitand(rhs: RHS) -> Result;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
#[lang="bitand"]
|
#[lang="bitand"]
|
||||||
trait BitAnd<RHS,Result> {
|
trait BitAnd<RHS,Result> {
|
||||||
pure fn bitand(rhs: &RHS) -> Result;
|
pure fn bitand(rhs: &RHS) -> Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
#[lang="bitor"]
|
|
||||||
trait BitOr<RHS,Result> {
|
|
||||||
pure fn bitor(rhs: RHS) -> Result;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
#[lang="bitor"]
|
#[lang="bitor"]
|
||||||
trait BitOr<RHS,Result> {
|
trait BitOr<RHS,Result> {
|
||||||
pure fn bitor(rhs: &RHS) -> Result;
|
pure fn bitor(rhs: &RHS) -> Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
#[lang="bitxor"]
|
|
||||||
trait BitXor<RHS,Result> {
|
|
||||||
pure fn bitxor(rhs: RHS) -> Result;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
#[lang="bitxor"]
|
#[lang="bitxor"]
|
||||||
trait BitXor<RHS,Result> {
|
trait BitXor<RHS,Result> {
|
||||||
pure fn bitxor(rhs: &RHS) -> Result;
|
pure fn bitxor(rhs: &RHS) -> Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
#[lang="shl"]
|
|
||||||
trait Shl<RHS,Result> {
|
|
||||||
pure fn shl(rhs: RHS) -> Result;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
#[lang="shl"]
|
#[lang="shl"]
|
||||||
trait Shl<RHS,Result> {
|
trait Shl<RHS,Result> {
|
||||||
pure fn shl(rhs: &RHS) -> Result;
|
pure fn shl(rhs: &RHS) -> Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
#[lang="shr"]
|
|
||||||
trait Shr<RHS,Result> {
|
|
||||||
pure fn shr(rhs: RHS) -> Result;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
#[lang="shr"]
|
#[lang="shr"]
|
||||||
trait Shr<RHS,Result> {
|
trait Shr<RHS,Result> {
|
||||||
pure fn shr(rhs: &RHS) -> Result;
|
pure fn shr(rhs: &RHS) -> Result;
|
||||||
|
@ -255,28 +255,6 @@ impl<T: Copy> Option<T> {
|
|||||||
pure fn while_some(blk: fn(+v: T) -> Option<T>) { while_some(self, blk) }
|
pure fn while_some(blk: fn(+v: T) -> Option<T>) { while_some(self, blk) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl<T: Eq> Option<T> : Eq {
|
|
||||||
pure fn eq(&&other: Option<T>) -> bool {
|
|
||||||
match self {
|
|
||||||
None => {
|
|
||||||
match other {
|
|
||||||
None => true,
|
|
||||||
Some(_) => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Some(self_contents) => {
|
|
||||||
match other {
|
|
||||||
None => false,
|
|
||||||
Some(other_contents) => self_contents.eq(other_contents)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: Option<T>) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl<T: Eq> Option<T> : Eq {
|
impl<T: Eq> Option<T> : Eq {
|
||||||
pure fn eq(other: &Option<T>) -> bool {
|
pure fn eq(other: &Option<T>) -> bool {
|
||||||
match self {
|
match self {
|
||||||
|
@ -70,16 +70,6 @@ impl PosixPath : ToStr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl PosixPath : Eq {
|
|
||||||
pure fn eq(&&other: PosixPath) -> bool {
|
|
||||||
return self.is_absolute == other.is_absolute &&
|
|
||||||
self.components == other.components;
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: PosixPath) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl PosixPath : Eq {
|
impl PosixPath : Eq {
|
||||||
pure fn eq(other: &PosixPath) -> bool {
|
pure fn eq(other: &PosixPath) -> bool {
|
||||||
return self.is_absolute == (*other).is_absolute &&
|
return self.is_absolute == (*other).is_absolute &&
|
||||||
@ -88,18 +78,6 @@ impl PosixPath : Eq {
|
|||||||
pure fn ne(other: &PosixPath) -> bool { !self.eq(other) }
|
pure fn ne(other: &PosixPath) -> bool { !self.eq(other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl WindowsPath : Eq {
|
|
||||||
pure fn eq(&&other: WindowsPath) -> bool {
|
|
||||||
return self.host == other.host &&
|
|
||||||
self.device == other.device &&
|
|
||||||
self.is_absolute == other.is_absolute &&
|
|
||||||
self.components == other.components;
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: WindowsPath) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl WindowsPath : Eq {
|
impl WindowsPath : Eq {
|
||||||
pure fn eq(other: &WindowsPath) -> bool {
|
pure fn eq(other: &WindowsPath) -> bool {
|
||||||
return self.host == (*other).host &&
|
return self.host == (*other).host &&
|
||||||
|
@ -116,15 +116,6 @@ enum State {
|
|||||||
Terminated
|
Terminated
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl State: Eq {
|
|
||||||
pure fn eq(&&other: State) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: State) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl State : Eq {
|
impl State : Eq {
|
||||||
pure fn eq(other: &State) -> bool {
|
pure fn eq(other: &State) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
|
@ -205,17 +205,6 @@ impl<T> *T: Ptr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Equality for pointers
|
// Equality for pointers
|
||||||
#[cfg(stage0)]
|
|
||||||
impl<T> *const T : Eq {
|
|
||||||
pure fn eq(&&other: *const T) -> bool unsafe {
|
|
||||||
let a: uint = cast::reinterpret_cast(&self);
|
|
||||||
let b: uint = cast::reinterpret_cast(&other);
|
|
||||||
return a == b;
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: *const T) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl<T> *const T : Eq {
|
impl<T> *const T : Eq {
|
||||||
pure fn eq(other: &*const T) -> bool unsafe {
|
pure fn eq(other: &*const T) -> bool unsafe {
|
||||||
let a: uint = cast::reinterpret_cast(&self);
|
let a: uint = cast::reinterpret_cast(&self);
|
||||||
@ -226,31 +215,6 @@ impl<T> *const T : Eq {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Comparison for pointers
|
// Comparison for pointers
|
||||||
#[cfg(stage0)]
|
|
||||||
impl<T> *const T : Ord {
|
|
||||||
pure fn lt(&&other: *const T) -> bool unsafe {
|
|
||||||
let a: uint = cast::reinterpret_cast(&self);
|
|
||||||
let b: uint = cast::reinterpret_cast(&other);
|
|
||||||
return a < b;
|
|
||||||
}
|
|
||||||
pure fn le(&&other: *const T) -> bool unsafe {
|
|
||||||
let a: uint = cast::reinterpret_cast(&self);
|
|
||||||
let b: uint = cast::reinterpret_cast(&other);
|
|
||||||
return a <= b;
|
|
||||||
}
|
|
||||||
pure fn ge(&&other: *const T) -> bool unsafe {
|
|
||||||
let a: uint = cast::reinterpret_cast(&self);
|
|
||||||
let b: uint = cast::reinterpret_cast(&other);
|
|
||||||
return a >= b;
|
|
||||||
}
|
|
||||||
pure fn gt(&&other: *const T) -> bool unsafe {
|
|
||||||
let a: uint = cast::reinterpret_cast(&self);
|
|
||||||
let b: uint = cast::reinterpret_cast(&other);
|
|
||||||
return a > b;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl<T> *const T : Ord {
|
impl<T> *const T : Ord {
|
||||||
pure fn lt(other: &*const T) -> bool unsafe {
|
pure fn lt(other: &*const T) -> bool unsafe {
|
||||||
let a: uint = cast::reinterpret_cast(&self);
|
let a: uint = cast::reinterpret_cast(&self);
|
||||||
@ -275,28 +239,12 @@ impl<T> *const T : Ord {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Equality for region pointers
|
// Equality for region pointers
|
||||||
#[cfg(stage0)]
|
|
||||||
impl<T:Eq> &const T : Eq {
|
|
||||||
pure fn eq(&&other: &const T) -> bool { return *self == *other; }
|
|
||||||
pure fn ne(&&other: &const T) -> bool { return *self != *other; }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl<T:Eq> &const T : Eq {
|
impl<T:Eq> &const T : Eq {
|
||||||
pure fn eq(other: & &const T) -> bool { return *self == *(*other); }
|
pure fn eq(other: & &const T) -> bool { return *self == *(*other); }
|
||||||
pure fn ne(other: & &const T) -> bool { return *self != *(*other); }
|
pure fn ne(other: & &const T) -> bool { return *self != *(*other); }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Comparison for region pointers
|
// Comparison for region pointers
|
||||||
#[cfg(stage0)]
|
|
||||||
impl<T:Ord> &const T : Ord {
|
|
||||||
pure fn lt(&&other: &const T) -> bool { *self < *other }
|
|
||||||
pure fn le(&&other: &const T) -> bool { *self <= *other }
|
|
||||||
pure fn ge(&&other: &const T) -> bool { *self >= *other }
|
|
||||||
pure fn gt(&&other: &const T) -> bool { *self > *other }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl<T:Ord> &const T : Ord {
|
impl<T:Ord> &const T : Ord {
|
||||||
pure fn lt(other: & &const T) -> bool { *self < *(*other) }
|
pure fn lt(other: & &const T) -> bool { *self < *(*other) }
|
||||||
pure fn le(other: & &const T) -> bool { *self <= *(*other) }
|
pure fn le(other: & &const T) -> bool { *self <= *(*other) }
|
||||||
|
@ -510,15 +510,6 @@ enum EnumVisitState {
|
|||||||
Degenerate // This is a degenerate enum (exactly 1 variant)
|
Degenerate // This is a degenerate enum (exactly 1 variant)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl EnumVisitState : cmp::Eq {
|
|
||||||
pure fn eq(&&other: EnumVisitState) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: EnumVisitState) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl EnumVisitState : cmp::Eq {
|
impl EnumVisitState : cmp::Eq {
|
||||||
pure fn eq(other: &EnumVisitState) -> bool {
|
pure fn eq(other: &EnumVisitState) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
|
@ -354,28 +354,6 @@ fn unwrap_err<T, U>(+res: Result<T, U>) -> U {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl<T:Eq,U:Eq> Result<T,U> : Eq {
|
|
||||||
pure fn eq(&&other: Result<T,U>) -> bool {
|
|
||||||
match self {
|
|
||||||
Ok(e0a) => {
|
|
||||||
match other {
|
|
||||||
Ok(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Err(e0a) => {
|
|
||||||
match other {
|
|
||||||
Err(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: Result<T,U>) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl<T:Eq,U:Eq> Result<T,U> : Eq {
|
impl<T:Eq,U:Eq> Result<T,U> : Eq {
|
||||||
pure fn eq(other: &Result<T,U>) -> bool {
|
pure fn eq(other: &Result<T,U>) -> bool {
|
||||||
match self {
|
match self {
|
||||||
|
@ -804,17 +804,6 @@ pure fn gt(a: &str, b: &str) -> bool {
|
|||||||
!le(a, b)
|
!le(a, b)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl &str: Eq {
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn eq(&&other: &str) -> bool {
|
|
||||||
eq_slice(self, other)
|
|
||||||
}
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn ne(&&other: &str) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl &str : Eq {
|
impl &str : Eq {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pure fn eq(other: & &str) -> bool {
|
pure fn eq(other: & &str) -> bool {
|
||||||
@ -824,17 +813,6 @@ impl &str : Eq {
|
|||||||
pure fn ne(other: & &str) -> bool { !self.eq(other) }
|
pure fn ne(other: & &str) -> bool { !self.eq(other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl ~str: Eq {
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn eq(&&other: ~str) -> bool {
|
|
||||||
eq_slice(self, other)
|
|
||||||
}
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn ne(&&other: ~str) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl ~str : Eq {
|
impl ~str : Eq {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pure fn eq(other: &~str) -> bool {
|
pure fn eq(other: &~str) -> bool {
|
||||||
@ -844,17 +822,6 @@ impl ~str : Eq {
|
|||||||
pure fn ne(other: &~str) -> bool { !self.eq(other) }
|
pure fn ne(other: &~str) -> bool { !self.eq(other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl @str: Eq {
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn eq(&&other: @str) -> bool {
|
|
||||||
eq_slice(self, other)
|
|
||||||
}
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn ne(&&other: @str) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl @str : Eq {
|
impl @str : Eq {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pure fn eq(other: &@str) -> bool {
|
pure fn eq(other: &@str) -> bool {
|
||||||
@ -864,19 +831,6 @@ impl @str : Eq {
|
|||||||
pure fn ne(other: &@str) -> bool { !self.eq(other) }
|
pure fn ne(other: &@str) -> bool { !self.eq(other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl ~str : Ord {
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn lt(&&other: ~str) -> bool { lt(self, other) }
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn le(&&other: ~str) -> bool { le(self, other) }
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn ge(&&other: ~str) -> bool { ge(self, other) }
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn gt(&&other: ~str) -> bool { gt(self, other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl ~str : Ord {
|
impl ~str : Ord {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pure fn lt(other: &~str) -> bool { lt(self, (*other)) }
|
pure fn lt(other: &~str) -> bool { lt(self, (*other)) }
|
||||||
@ -888,19 +842,6 @@ impl ~str : Ord {
|
|||||||
pure fn gt(other: &~str) -> bool { gt(self, (*other)) }
|
pure fn gt(other: &~str) -> bool { gt(self, (*other)) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl &str : Ord {
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn lt(&&other: &str) -> bool { lt(self, other) }
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn le(&&other: &str) -> bool { le(self, other) }
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn ge(&&other: &str) -> bool { ge(self, other) }
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn gt(&&other: &str) -> bool { gt(self, other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl &str : Ord {
|
impl &str : Ord {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pure fn lt(other: & &str) -> bool { lt(self, (*other)) }
|
pure fn lt(other: & &str) -> bool { lt(self, (*other)) }
|
||||||
@ -912,19 +853,6 @@ impl &str : Ord {
|
|||||||
pure fn gt(other: & &str) -> bool { gt(self, (*other)) }
|
pure fn gt(other: & &str) -> bool { gt(self, (*other)) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl @str : Ord {
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn lt(&&other: @str) -> bool { lt(self, other) }
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn le(&&other: @str) -> bool { le(self, other) }
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn ge(&&other: @str) -> bool { ge(self, other) }
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn gt(&&other: @str) -> bool { gt(self, other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl @str : Ord {
|
impl @str : Ord {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pure fn lt(other: &@str) -> bool { lt(self, (*other)) }
|
pure fn lt(other: &@str) -> bool { lt(self, (*other)) }
|
||||||
@ -2244,15 +2172,6 @@ impl ~str: UniqueStr {
|
|||||||
#[cfg(notest)]
|
#[cfg(notest)]
|
||||||
mod traits {
|
mod traits {
|
||||||
#[legacy_exports];
|
#[legacy_exports];
|
||||||
#[cfg(stage0)]
|
|
||||||
impl ~str: Add<&str,~str> {
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn add(rhs: &str) -> ~str {
|
|
||||||
append(copy self, rhs)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl ~str : Add<&str,~str> {
|
impl ~str : Add<&str,~str> {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pure fn add(rhs: & &str) -> ~str {
|
pure fn add(rhs: & &str) -> ~str {
|
||||||
|
@ -83,13 +83,6 @@ enum Task {
|
|||||||
TaskHandle(task_id)
|
TaskHandle(task_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl Task : cmp::Eq {
|
|
||||||
pure fn eq(&&other: Task) -> bool { *self == *other }
|
|
||||||
pure fn ne(&&other: Task) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl Task : cmp::Eq {
|
impl Task : cmp::Eq {
|
||||||
pure fn eq(other: &Task) -> bool { *self == *(*other) }
|
pure fn eq(other: &Task) -> bool { *self == *(*other) }
|
||||||
pure fn ne(other: &Task) -> bool { !self.eq(other) }
|
pure fn ne(other: &Task) -> bool { !self.eq(other) }
|
||||||
@ -111,18 +104,6 @@ enum TaskResult {
|
|||||||
Failure,
|
Failure,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl TaskResult: Eq {
|
|
||||||
pure fn eq(&&other: TaskResult) -> bool {
|
|
||||||
match (self, other) {
|
|
||||||
(Success, Success) | (Failure, Failure) => true,
|
|
||||||
(Success, _) | (Failure, _) => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: TaskResult) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl TaskResult : Eq {
|
impl TaskResult : Eq {
|
||||||
pure fn eq(other: &TaskResult) -> bool {
|
pure fn eq(other: &TaskResult) -> bool {
|
||||||
match (self, (*other)) {
|
match (self, (*other)) {
|
||||||
@ -139,21 +120,6 @@ enum Notification {
|
|||||||
Exit(Task, TaskResult)
|
Exit(Task, TaskResult)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl Notification : cmp::Eq {
|
|
||||||
pure fn eq(&&other: Notification) -> bool {
|
|
||||||
match self {
|
|
||||||
Exit(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
Exit(e0b, e1b) => e0a == e0b && e1a == e1b
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: Notification) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl Notification : cmp::Eq {
|
impl Notification : cmp::Eq {
|
||||||
pure fn eq(other: &Notification) -> bool {
|
pure fn eq(other: &Notification) -> bool {
|
||||||
match self {
|
match self {
|
||||||
@ -186,48 +152,6 @@ enum SchedMode {
|
|||||||
PlatformThread
|
PlatformThread
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl SchedMode : cmp::Eq {
|
|
||||||
pure fn eq(&&other: SchedMode) -> bool {
|
|
||||||
match self {
|
|
||||||
SingleThreaded => {
|
|
||||||
match other {
|
|
||||||
SingleThreaded => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ThreadPerCore => {
|
|
||||||
match other {
|
|
||||||
ThreadPerCore => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ThreadPerTask => {
|
|
||||||
match other {
|
|
||||||
ThreadPerTask => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ManualThreads(e0a) => {
|
|
||||||
match other {
|
|
||||||
ManualThreads(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
PlatformThread => {
|
|
||||||
match other {
|
|
||||||
PlatformThread => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: SchedMode) -> bool {
|
|
||||||
!self.eq(other)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl SchedMode : cmp::Eq {
|
impl SchedMode : cmp::Eq {
|
||||||
pure fn eq(other: &SchedMode) -> bool {
|
pure fn eq(other: &SchedMode) -> bool {
|
||||||
match self {
|
match self {
|
||||||
|
@ -6,17 +6,6 @@ use rt::rust_task;
|
|||||||
trait LocalData { }
|
trait LocalData { }
|
||||||
impl<T: Owned> @T: LocalData { }
|
impl<T: Owned> @T: LocalData { }
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl LocalData: Eq {
|
|
||||||
pure fn eq(&&other: LocalData) -> bool unsafe {
|
|
||||||
let ptr_a: (uint, uint) = cast::reinterpret_cast(&self);
|
|
||||||
let ptr_b: (uint, uint) = cast::reinterpret_cast(&other);
|
|
||||||
return ptr_a == ptr_b;
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: LocalData) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl LocalData: Eq {
|
impl LocalData: Eq {
|
||||||
pure fn eq(other: &@LocalData) -> bool unsafe {
|
pure fn eq(other: &@LocalData) -> bool unsafe {
|
||||||
let ptr_a: (uint, uint) = cast::reinterpret_cast(&self);
|
let ptr_a: (uint, uint) = cast::reinterpret_cast(&self);
|
||||||
|
@ -67,25 +67,6 @@ impl<A: Copy, B: Copy> (~[A], ~[B]): ExtendedTupleOps<A,B> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl<A: Eq, B: Eq> (A, B): Eq {
|
|
||||||
pure fn eq(&&other: (A, B)) -> bool {
|
|
||||||
// XXX: This would be a lot less wordy with ref bindings, but I don't
|
|
||||||
// trust that they work yet.
|
|
||||||
match self {
|
|
||||||
(self_a, self_b) => {
|
|
||||||
match other {
|
|
||||||
(other_a, other_b) => {
|
|
||||||
self_a.eq(other_a) && self_b.eq(other_b)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: (A, B)) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl<A: Eq, B: Eq> (A, B) : Eq {
|
impl<A: Eq, B: Eq> (A, B) : Eq {
|
||||||
pure fn eq(other: &(A, B)) -> bool {
|
pure fn eq(other: &(A, B)) -> bool {
|
||||||
// XXX: This would be a lot less wordy with ref bindings, but I don't
|
// XXX: This would be a lot less wordy with ref bindings, but I don't
|
||||||
@ -103,28 +84,6 @@ impl<A: Eq, B: Eq> (A, B) : Eq {
|
|||||||
pure fn ne(other: &(A, B)) -> bool { !self.eq(other) }
|
pure fn ne(other: &(A, B)) -> bool { !self.eq(other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl<A: Ord, B: Ord> (A, B): Ord {
|
|
||||||
pure fn lt(&&other: (A, B)) -> bool {
|
|
||||||
match self {
|
|
||||||
(self_a, self_b) => {
|
|
||||||
match other {
|
|
||||||
(other_a, other_b) => {
|
|
||||||
if self_a.lt(other_a) { return true; }
|
|
||||||
if other_a.lt(self_a) { return false; }
|
|
||||||
if self_b.lt(other_b) { return true; }
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn le(&&other: (A, B)) -> bool { !other.lt(self) }
|
|
||||||
pure fn ge(&&other: (A, B)) -> bool { !self.lt(other) }
|
|
||||||
pure fn gt(&&other: (A, B)) -> bool { other.lt(self) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl<A: Ord, B: Ord> (A, B) : Ord {
|
impl<A: Ord, B: Ord> (A, B) : Ord {
|
||||||
pure fn lt(other: &(A, B)) -> bool {
|
pure fn lt(other: &(A, B)) -> bool {
|
||||||
match self {
|
match self {
|
||||||
@ -145,27 +104,6 @@ impl<A: Ord, B: Ord> (A, B) : Ord {
|
|||||||
pure fn gt(other: &(A, B)) -> bool { (*other).lt(&self) }
|
pure fn gt(other: &(A, B)) -> bool { (*other).lt(&self) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl<A: Eq, B: Eq, C: Eq> (A, B, C): Eq {
|
|
||||||
pure fn eq(&&other: (A, B, C)) -> bool {
|
|
||||||
// XXX: This would be a lot less wordy with ref bindings, but I don't
|
|
||||||
// trust that they work yet.
|
|
||||||
match self {
|
|
||||||
(self_a, self_b, self_c) => {
|
|
||||||
match other {
|
|
||||||
(other_a, other_b, other_c) => {
|
|
||||||
self_a.eq(other_a) &&
|
|
||||||
self_b.eq(other_b) &&
|
|
||||||
self_c.eq(other_c)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: (A, B, C)) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl<A: Eq, B: Eq, C: Eq> (A, B, C) : Eq {
|
impl<A: Eq, B: Eq, C: Eq> (A, B, C) : Eq {
|
||||||
pure fn eq(other: &(A, B, C)) -> bool {
|
pure fn eq(other: &(A, B, C)) -> bool {
|
||||||
// XXX: This would be a lot less wordy with ref bindings, but I don't
|
// XXX: This would be a lot less wordy with ref bindings, but I don't
|
||||||
@ -185,30 +123,6 @@ impl<A: Eq, B: Eq, C: Eq> (A, B, C) : Eq {
|
|||||||
pure fn ne(other: &(A, B, C)) -> bool { !self.eq(other) }
|
pure fn ne(other: &(A, B, C)) -> bool { !self.eq(other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl<A: Ord, B: Ord, C: Ord> (A, B, C): Ord {
|
|
||||||
pure fn lt(&&other: (A, B, C)) -> bool {
|
|
||||||
match self {
|
|
||||||
(self_a, self_b, self_c) => {
|
|
||||||
match other {
|
|
||||||
(other_a, other_b, other_c) => {
|
|
||||||
if self_a.lt(other_a) { return true; }
|
|
||||||
if other_a.lt(self_a) { return false; }
|
|
||||||
if self_b.lt(other_b) { return true; }
|
|
||||||
if other_b.lt(self_b) { return false; }
|
|
||||||
if self_c.lt(other_c) { return true; }
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn le(&&other: (A, B, C)) -> bool { !other.lt(self) }
|
|
||||||
pure fn ge(&&other: (A, B, C)) -> bool { !self.lt(other) }
|
|
||||||
pure fn gt(&&other: (A, B, C)) -> bool { other.lt(self) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl<A: Ord, B: Ord, C: Ord> (A, B, C) : Ord {
|
impl<A: Ord, B: Ord, C: Ord> (A, B, C) : Ord {
|
||||||
pure fn lt(other: &(A, B, C)) -> bool {
|
pure fn lt(other: &(A, B, C)) -> bool {
|
||||||
match self {
|
match self {
|
||||||
|
@ -61,15 +61,6 @@ pure fn compl(i: T) -> T {
|
|||||||
max_value ^ i
|
max_value ^ i
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl T: Ord {
|
|
||||||
pure fn lt(&&other: T) -> bool { self < other }
|
|
||||||
pure fn le(&&other: T) -> bool { self <= other }
|
|
||||||
pure fn ge(&&other: T) -> bool { self >= other }
|
|
||||||
pure fn gt(&&other: T) -> bool { self > other }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl T : Ord {
|
impl T : Ord {
|
||||||
pure fn lt(other: &T) -> bool { self < (*other) }
|
pure fn lt(other: &T) -> bool { self < (*other) }
|
||||||
pure fn le(other: &T) -> bool { self <= (*other) }
|
pure fn le(other: &T) -> bool { self <= (*other) }
|
||||||
@ -77,13 +68,6 @@ impl T : Ord {
|
|||||||
pure fn gt(other: &T) -> bool { self > (*other) }
|
pure fn gt(other: &T) -> bool { self > (*other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl T: Eq {
|
|
||||||
pure fn eq(&&other: T) -> bool { return self == other; }
|
|
||||||
pure fn ne(&&other: T) -> bool { return self != other; }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl T : Eq {
|
impl T : Eq {
|
||||||
pure fn eq(other: &T) -> bool { return self == (*other); }
|
pure fn eq(other: &T) -> bool { return self == (*other); }
|
||||||
pure fn ne(other: &T) -> bool { return self != (*other); }
|
pure fn ne(other: &T) -> bool { return self != (*other); }
|
||||||
|
@ -2,27 +2,11 @@
|
|||||||
|
|
||||||
use cmp::{Eq, Ord};
|
use cmp::{Eq, Ord};
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl<T:Eq> ~const T : Eq {
|
|
||||||
pure fn eq(&&other: ~const T) -> bool { *self == *other }
|
|
||||||
pure fn ne(&&other: ~const T) -> bool { *self != *other }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl<T:Eq> ~const T : Eq {
|
impl<T:Eq> ~const T : Eq {
|
||||||
pure fn eq(other: &~const T) -> bool { *self == *(*other) }
|
pure fn eq(other: &~const T) -> bool { *self == *(*other) }
|
||||||
pure fn ne(other: &~const T) -> bool { *self != *(*other) }
|
pure fn ne(other: &~const T) -> bool { *self != *(*other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl<T:Ord> ~const T : Ord {
|
|
||||||
pure fn lt(&&other: ~const T) -> bool { *self < *other }
|
|
||||||
pure fn le(&&other: ~const T) -> bool { *self <= *other }
|
|
||||||
pure fn ge(&&other: ~const T) -> bool { *self >= *other }
|
|
||||||
pure fn gt(&&other: ~const T) -> bool { *self > *other }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl<T:Ord> ~const T : Ord {
|
impl<T:Ord> ~const T : Ord {
|
||||||
pure fn lt(other: &~const T) -> bool { *self < *(*other) }
|
pure fn lt(other: &~const T) -> bool { *self < *(*other) }
|
||||||
pure fn le(other: &~const T) -> bool { *self <= *(*other) }
|
pure fn le(other: &~const T) -> bool { *self <= *(*other) }
|
||||||
|
@ -6,27 +6,11 @@ Functions for the unit type.
|
|||||||
|
|
||||||
use cmp::{Eq, Ord};
|
use cmp::{Eq, Ord};
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl () : Eq {
|
|
||||||
pure fn eq(&&_other: ()) -> bool { true }
|
|
||||||
pure fn ne(&&_other: ()) -> bool { false }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl () : Eq {
|
impl () : Eq {
|
||||||
pure fn eq(_other: &()) -> bool { true }
|
pure fn eq(_other: &()) -> bool { true }
|
||||||
pure fn ne(_other: &()) -> bool { false }
|
pure fn ne(_other: &()) -> bool { false }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl () : Ord {
|
|
||||||
pure fn lt(&&_other: ()) -> bool { false }
|
|
||||||
pure fn le(&&_other: ()) -> bool { true }
|
|
||||||
pure fn ge(&&_other: ()) -> bool { true }
|
|
||||||
pure fn gt(&&_other: ()) -> bool { false }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl () : Ord {
|
impl () : Ord {
|
||||||
pure fn lt(_other: &()) -> bool { false }
|
pure fn lt(_other: &()) -> bool { false }
|
||||||
pure fn le(_other: &()) -> bool { true }
|
pure fn le(_other: &()) -> bool { true }
|
||||||
|
@ -1370,15 +1370,6 @@ pure fn eq<T: Eq>(a: &[T], b: &[T]) -> bool {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl<T: Eq> &[T]: Eq {
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn eq(&&other: &[T]) -> bool { eq(self, other) }
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn ne(&&other: &[T]) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl<T: Eq> &[T] : Eq {
|
impl<T: Eq> &[T] : Eq {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pure fn eq(other: & &[T]) -> bool { eq(self, (*other)) }
|
pure fn eq(other: & &[T]) -> bool { eq(self, (*other)) }
|
||||||
@ -1386,15 +1377,6 @@ impl<T: Eq> &[T] : Eq {
|
|||||||
pure fn ne(other: & &[T]) -> bool { !self.eq(other) }
|
pure fn ne(other: & &[T]) -> bool { !self.eq(other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl<T: Eq> ~[T]: Eq {
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn eq(&&other: ~[T]) -> bool { eq(self, other) }
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn ne(&&other: ~[T]) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl<T: Eq> ~[T] : Eq {
|
impl<T: Eq> ~[T] : Eq {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pure fn eq(other: &~[T]) -> bool { eq(self, (*other)) }
|
pure fn eq(other: &~[T]) -> bool { eq(self, (*other)) }
|
||||||
@ -1402,15 +1384,6 @@ impl<T: Eq> ~[T] : Eq {
|
|||||||
pure fn ne(other: &~[T]) -> bool { !self.eq(other) }
|
pure fn ne(other: &~[T]) -> bool { !self.eq(other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl<T: Eq> @[T]: Eq {
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn eq(&&other: @[T]) -> bool { eq(self, other) }
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn ne(&&other: @[T]) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl<T: Eq> @[T] : Eq {
|
impl<T: Eq> @[T] : Eq {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pure fn eq(other: &@[T]) -> bool { eq(self, (*other)) }
|
pure fn eq(other: &@[T]) -> bool { eq(self, (*other)) }
|
||||||
@ -1439,19 +1412,6 @@ pure fn le<T: Ord>(a: &[T], b: &[T]) -> bool { !lt(b, a) }
|
|||||||
pure fn ge<T: Ord>(a: &[T], b: &[T]) -> bool { !lt(a, b) }
|
pure fn ge<T: Ord>(a: &[T], b: &[T]) -> bool { !lt(a, b) }
|
||||||
pure fn gt<T: Ord>(a: &[T], b: &[T]) -> bool { lt(b, a) }
|
pure fn gt<T: Ord>(a: &[T], b: &[T]) -> bool { lt(b, a) }
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl<T: Ord> &[T]: Ord {
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn lt(&&other: &[T]) -> bool { lt(self, other) }
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn le(&&other: &[T]) -> bool { le(self, other) }
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn ge(&&other: &[T]) -> bool { ge(self, other) }
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn gt(&&other: &[T]) -> bool { gt(self, other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl<T: Ord> &[T] : Ord {
|
impl<T: Ord> &[T] : Ord {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pure fn lt(other: & &[T]) -> bool { lt(self, (*other)) }
|
pure fn lt(other: & &[T]) -> bool { lt(self, (*other)) }
|
||||||
@ -1463,19 +1423,6 @@ impl<T: Ord> &[T] : Ord {
|
|||||||
pure fn gt(other: & &[T]) -> bool { gt(self, (*other)) }
|
pure fn gt(other: & &[T]) -> bool { gt(self, (*other)) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl<T: Ord> ~[T]: Ord {
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn lt(&&other: ~[T]) -> bool { lt(self, other) }
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn le(&&other: ~[T]) -> bool { le(self, other) }
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn ge(&&other: ~[T]) -> bool { ge(self, other) }
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn gt(&&other: ~[T]) -> bool { gt(self, other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl<T: Ord> ~[T] : Ord {
|
impl<T: Ord> ~[T] : Ord {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pure fn lt(other: &~[T]) -> bool { lt(self, (*other)) }
|
pure fn lt(other: &~[T]) -> bool { lt(self, (*other)) }
|
||||||
@ -1487,19 +1434,6 @@ impl<T: Ord> ~[T] : Ord {
|
|||||||
pure fn gt(other: &~[T]) -> bool { gt(self, (*other)) }
|
pure fn gt(other: &~[T]) -> bool { gt(self, (*other)) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl<T: Ord> @[T]: Ord {
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn lt(&&other: @[T]) -> bool { lt(self, other) }
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn le(&&other: @[T]) -> bool { le(self, other) }
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn ge(&&other: @[T]) -> bool { ge(self, other) }
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn gt(&&other: @[T]) -> bool { gt(self, other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl<T: Ord> @[T] : Ord {
|
impl<T: Ord> @[T] : Ord {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pure fn lt(other: &@[T]) -> bool { lt(self, (*other)) }
|
pure fn lt(other: &@[T]) -> bool { lt(self, (*other)) }
|
||||||
@ -1514,16 +1448,6 @@ impl<T: Ord> @[T] : Ord {
|
|||||||
#[cfg(notest)]
|
#[cfg(notest)]
|
||||||
mod traits {
|
mod traits {
|
||||||
#[legacy_exports];
|
#[legacy_exports];
|
||||||
#[cfg(stage0)]
|
|
||||||
impl<T: Copy> ~[T]: Add<&[const T],~[T]> {
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn add(rhs: &[const T]) -> ~[T] {
|
|
||||||
append(copy self, rhs)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl<T: Copy> ~[T] : Add<&[const T],~[T]> {
|
impl<T: Copy> ~[T] : Add<&[const T],~[T]> {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pure fn add(rhs: & &[const T]) -> ~[T] {
|
pure fn add(rhs: & &[const T]) -> ~[T] {
|
||||||
@ -1531,16 +1455,6 @@ mod traits {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl<T: Copy> ~[mut T]: Add<&[const T],~[mut T]> {
|
|
||||||
#[inline(always)]
|
|
||||||
pure fn add(rhs: &[const T]) -> ~[mut T] {
|
|
||||||
append_mut(copy self, rhs)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl<T: Copy> ~[mut T] : Add<&[const T],~[mut T]> {
|
impl<T: Copy> ~[mut T] : Add<&[const T],~[mut T]> {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pure fn add(rhs: & &[const T]) -> ~[mut T] {
|
pure fn add(rhs: & &[const T]) -> ~[mut T] {
|
||||||
|
@ -240,28 +240,6 @@ mod tests {
|
|||||||
|
|
||||||
type RecCy = {x: int, y: int, t: Taggy};
|
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 {
|
impl Taggy : Eq {
|
||||||
pure fn eq(other: &Taggy) -> bool {
|
pure fn eq(other: &Taggy) -> bool {
|
||||||
match self {
|
match self {
|
||||||
@ -282,31 +260,6 @@ mod tests {
|
|||||||
pure fn ne(other: &Taggy) -> bool { !self.eq(other) }
|
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 {
|
impl Taggypar<int> : Eq {
|
||||||
//let eq4: EqFn<Taggypar<int>> = |x,y| taggypareq::<int>(x, y);
|
//let eq4: EqFn<Taggypar<int>> = |x,y| taggypareq::<int>(x, y);
|
||||||
pure fn eq(other: &Taggypar<int>) -> bool {
|
pure fn eq(other: &Taggypar<int>) -> bool {
|
||||||
@ -330,15 +283,6 @@ mod tests {
|
|||||||
pure fn ne(other: &Taggypar<int>) -> bool { !self.eq(other) }
|
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 {
|
impl RecCy : Eq {
|
||||||
pure fn eq(other: &RecCy) -> bool {
|
pure fn eq(other: &RecCy) -> bool {
|
||||||
return self.x == (*other).x && self.y == (*other).y &&
|
return self.x == (*other).x && self.y == (*other).y &&
|
||||||
|
@ -107,28 +107,6 @@ fn mkname(nm: &str) -> Name {
|
|||||||
} else { Long(unm) };
|
} 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 {
|
impl Name : Eq {
|
||||||
pure fn eq(other: &Name) -> bool {
|
pure fn eq(other: &Name) -> bool {
|
||||||
match self {
|
match self {
|
||||||
@ -149,15 +127,6 @@ impl Name : Eq {
|
|||||||
pure fn ne(other: &Name) -> bool { !self.eq(other) }
|
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 {
|
impl Occur : Eq {
|
||||||
pure fn eq(other: &Occur) -> bool {
|
pure fn eq(other: &Occur) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
@ -478,15 +447,6 @@ enum FailType {
|
|||||||
UnexpectedArgument_,
|
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 {
|
impl FailType : Eq {
|
||||||
pure fn eq(other: &FailType) -> bool {
|
pure fn eq(other: &FailType) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
|
@ -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 {
|
impl Error : Eq {
|
||||||
pure fn eq(other: &Error) -> bool {
|
pure fn eq(other: &Error) -> bool {
|
||||||
self.line == (*other).line &&
|
self.line == (*other).line &&
|
||||||
@ -696,27 +685,11 @@ impl Error : Eq {
|
|||||||
pure fn ne(other: &Error) -> bool { !self.eq(other) }
|
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 {
|
impl Json : Eq {
|
||||||
pure fn eq(other: &Json) -> bool { eq(self, (*other)) }
|
pure fn eq(other: &Json) -> bool { eq(self, (*other)) }
|
||||||
pure fn ne(other: &Json) -> bool { !self.eq(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 {
|
impl Json : Ord {
|
||||||
pure fn lt(other: &Json) -> bool { lt(self, (*other)) }
|
pure fn lt(other: &Json) -> bool { lt(self, (*other)) }
|
||||||
pure fn le(other: &Json) -> bool { !(*other).lt(&self) }
|
pure fn le(other: &Json) -> bool { !(*other).lt(&self) }
|
||||||
|
@ -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 {
|
impl<T:Eq> List<T> : Eq {
|
||||||
pure fn eq(other: &List<T>) -> bool {
|
pure fn eq(other: &List<T>) -> bool {
|
||||||
match self {
|
match self {
|
||||||
|
@ -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 {
|
impl UserInfo : Eq {
|
||||||
pure fn eq(other: &UserInfo) -> bool {
|
pure fn eq(other: &UserInfo) -> bool {
|
||||||
self.user == (*other).user && self.pass == (*other).pass
|
self.user == (*other).user && self.pass == (*other).pass
|
||||||
@ -386,22 +377,6 @@ enum Input {
|
|||||||
Unreserved // all other legal characters
|
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 {
|
impl Input : Eq {
|
||||||
pure fn eq(other: &Input) -> bool {
|
pure fn eq(other: &Input) -> bool {
|
||||||
match (self, (*other)) {
|
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 {
|
impl Url : Eq {
|
||||||
pure fn eq(other: &Url) -> bool {
|
pure fn eq(other: &Url) -> bool {
|
||||||
self.scheme == (*other).scheme
|
self.scheme == (*other).scheme
|
||||||
|
@ -96,15 +96,6 @@ fn parse_opts(args: &[~str]) -> OptRes {
|
|||||||
|
|
||||||
enum TestResult { TrOk, TrFailed, TrIgnored, }
|
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 {
|
impl TestResult : Eq {
|
||||||
pure fn eq(other: &TestResult) -> bool {
|
pure fn eq(other: &TestResult) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
|
@ -37,15 +37,6 @@ extern mod rustrt {
|
|||||||
/// A record specifying a time value in seconds and nanoseconds.
|
/// A record specifying a time value in seconds and nanoseconds.
|
||||||
type Timespec = {sec: i64, nsec: i32};
|
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 {
|
impl Timespec : Eq {
|
||||||
pure fn eq(other: &Timespec) -> bool {
|
pure fn eq(other: &Timespec) -> bool {
|
||||||
self.sec == (*other).sec && self.nsec == (*other).nsec
|
self.sec == (*other).sec && self.nsec == (*other).nsec
|
||||||
@ -101,26 +92,6 @@ type Tm_ = {
|
|||||||
tm_nsec: i32, // nanoseconds
|
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 {
|
impl Tm_ : Eq {
|
||||||
pure fn eq(other: &Tm_) -> bool {
|
pure fn eq(other: &Tm_) -> bool {
|
||||||
self.tm_sec == (*other).tm_sec &&
|
self.tm_sec == (*other).tm_sec &&
|
||||||
@ -143,13 +114,6 @@ enum Tm {
|
|||||||
Tm_(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 {
|
impl Tm : Eq {
|
||||||
pure fn eq(other: &Tm) -> bool { *self == *(*other) }
|
pure fn eq(other: &Tm) -> bool { *self == *(*other) }
|
||||||
pure fn ne(other: &Tm) -> bool { *self != *(*other) }
|
pure fn ne(other: &Tm) -> bool { *self != *(*other) }
|
||||||
|
@ -81,15 +81,6 @@ type node_id = int;
|
|||||||
#[auto_serialize]
|
#[auto_serialize]
|
||||||
type def_id = {crate: crate_num, node: node_id};
|
type def_id = {crate: crate_num, node: node_id};
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl def_id: cmp::Eq {
|
|
||||||
pure fn eq(&&other: def_id) -> bool {
|
|
||||||
self.crate == other.crate && self.node == other.node
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: def_id) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl def_id : cmp::Eq {
|
impl def_id : cmp::Eq {
|
||||||
pure fn eq(other: &def_id) -> bool {
|
pure fn eq(other: &def_id) -> bool {
|
||||||
self.crate == (*other).crate && self.node == (*other).node
|
self.crate == (*other).crate && self.node == (*other).node
|
||||||
@ -138,131 +129,6 @@ enum def {
|
|||||||
def_label(node_id)
|
def_label(node_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl def : cmp::Eq {
|
|
||||||
pure fn eq(&&other: def) -> bool {
|
|
||||||
match self {
|
|
||||||
def_fn(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
def_fn(e0b, e1b) => e0a == e0b && e1a == e1b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
def_static_method(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
def_static_method(e0b, e1b) => e0a == e0b && e1a == e1b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
def_self(e0a) => {
|
|
||||||
match other {
|
|
||||||
def_self(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
def_mod(e0a) => {
|
|
||||||
match other {
|
|
||||||
def_mod(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
def_foreign_mod(e0a) => {
|
|
||||||
match other {
|
|
||||||
def_foreign_mod(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
def_const(e0a) => {
|
|
||||||
match other {
|
|
||||||
def_const(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
def_arg(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
def_arg(e0b, e1b) => e0a == e0b && e1a == e1b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
def_local(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
def_local(e0b, e1b) => e0a == e0b && e1a == e1b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
def_variant(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
def_variant(e0b, e1b) => e0a == e0b && e1a == e1b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
def_ty(e0a) => {
|
|
||||||
match other {
|
|
||||||
def_ty(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
def_prim_ty(e0a) => {
|
|
||||||
match other {
|
|
||||||
def_prim_ty(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
def_ty_param(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
def_ty_param(e0b, e1b) => e0a == e0b && e1a == e1b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
def_binding(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
def_binding(e0b, e1b) => e0a == e0b && e1a == e1b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
def_use(e0a) => {
|
|
||||||
match other {
|
|
||||||
def_use(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
def_upvar(e0a, e1a, e2a, e3a) => {
|
|
||||||
match other {
|
|
||||||
def_upvar(e0b, e1b, e2b, e3b) =>
|
|
||||||
e0a == e0b && e1a == e1b && e2a == e2b && e3a == e3b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
def_class(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
def_class(e0b, e1b) => e0a == e0b && e1a == e1b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
def_typaram_binder(e0a) => {
|
|
||||||
match other {
|
|
||||||
def_typaram_binder(e1a) => e0a == e1a,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
def_region(e0a) => {
|
|
||||||
match other {
|
|
||||||
def_region(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
def_label(e0a) => {
|
|
||||||
match other {
|
|
||||||
def_label(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: def) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl def : cmp::Eq {
|
impl def : cmp::Eq {
|
||||||
pure fn eq(other: &def) -> bool {
|
pure fn eq(other: &def) -> bool {
|
||||||
match self {
|
match self {
|
||||||
@ -464,40 +330,6 @@ impl binding_mode : to_bytes::IterBytes {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl binding_mode : cmp::Eq {
|
|
||||||
pure fn eq(&&other: binding_mode) -> bool {
|
|
||||||
match self {
|
|
||||||
bind_by_value => {
|
|
||||||
match other {
|
|
||||||
bind_by_value => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
bind_by_move => {
|
|
||||||
match other {
|
|
||||||
bind_by_move => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
bind_by_ref(e0a) => {
|
|
||||||
match other {
|
|
||||||
bind_by_ref(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
bind_by_implicit_ref => {
|
|
||||||
match other {
|
|
||||||
bind_by_implicit_ref => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: binding_mode) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl binding_mode : cmp::Eq {
|
impl binding_mode : cmp::Eq {
|
||||||
pure fn eq(other: &binding_mode) -> bool {
|
pure fn eq(other: &binding_mode) -> bool {
|
||||||
match self {
|
match self {
|
||||||
@ -562,15 +394,6 @@ impl mutability : to_bytes::IterBytes {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl mutability: cmp::Eq {
|
|
||||||
pure fn eq(&&other: mutability) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: mutability) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl mutability : cmp::Eq {
|
impl mutability : cmp::Eq {
|
||||||
pure fn eq(other: &mutability) -> bool {
|
pure fn eq(other: &mutability) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
@ -586,15 +409,6 @@ enum proto {
|
|||||||
proto_block, // fn&
|
proto_block, // fn&
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl proto : cmp::Eq {
|
|
||||||
pure fn eq(&&other: proto) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: proto) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl proto : cmp::Eq {
|
impl proto : cmp::Eq {
|
||||||
pure fn eq(other: &proto) -> bool {
|
pure fn eq(other: &proto) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
@ -649,15 +463,6 @@ enum binop {
|
|||||||
gt,
|
gt,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl binop : cmp::Eq {
|
|
||||||
pure fn eq(&&other: binop) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: binop) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl binop : cmp::Eq {
|
impl binop : cmp::Eq {
|
||||||
pure fn eq(other: &binop) -> bool {
|
pure fn eq(other: &binop) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
@ -674,48 +479,6 @@ enum unop {
|
|||||||
neg
|
neg
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl unop : cmp::Eq {
|
|
||||||
pure fn eq(&&other: unop) -> bool {
|
|
||||||
match self {
|
|
||||||
box(e0a) => {
|
|
||||||
match other {
|
|
||||||
box(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
uniq(e0a) => {
|
|
||||||
match other {
|
|
||||||
uniq(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
deref => {
|
|
||||||
match other {
|
|
||||||
deref => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
not => {
|
|
||||||
match other {
|
|
||||||
not => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
neg => {
|
|
||||||
match other {
|
|
||||||
neg => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: unop) -> bool {
|
|
||||||
!self.eq(other)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl unop : cmp::Eq {
|
impl unop : cmp::Eq {
|
||||||
pure fn eq(other: &unop) -> bool {
|
pure fn eq(other: &unop) -> bool {
|
||||||
match self {
|
match self {
|
||||||
@ -776,28 +539,6 @@ impl<T: to_bytes::IterBytes> inferable<T> : to_bytes::IterBytes {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl<T:cmp::Eq> inferable<T> : cmp::Eq {
|
|
||||||
pure fn eq(&&other: inferable<T>) -> bool {
|
|
||||||
match self {
|
|
||||||
expl(e0a) => {
|
|
||||||
match other {
|
|
||||||
expl(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
infer(e0a) => {
|
|
||||||
match other {
|
|
||||||
infer(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: inferable<T>) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl<T:cmp::Eq> inferable<T> : cmp::Eq {
|
impl<T:cmp::Eq> inferable<T> : cmp::Eq {
|
||||||
pure fn eq(other: &inferable<T>) -> bool {
|
pure fn eq(other: &inferable<T>) -> bool {
|
||||||
match self {
|
match self {
|
||||||
@ -829,15 +570,6 @@ impl rmode : to_bytes::IterBytes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl rmode : cmp::Eq {
|
|
||||||
pure fn eq(&&other: rmode) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: rmode) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl rmode : cmp::Eq {
|
impl rmode : cmp::Eq {
|
||||||
pure fn eq(other: &rmode) -> bool {
|
pure fn eq(other: &rmode) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
@ -866,28 +598,6 @@ enum stmt_ {
|
|||||||
#[auto_serialize]
|
#[auto_serialize]
|
||||||
enum init_op { init_assign, init_move, }
|
enum init_op { init_assign, init_move, }
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl init_op : cmp::Eq {
|
|
||||||
pure fn eq(&&other: init_op) -> bool {
|
|
||||||
match self {
|
|
||||||
init_assign => {
|
|
||||||
match other {
|
|
||||||
init_assign => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
init_move => {
|
|
||||||
match other {
|
|
||||||
init_move => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: init_op) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl init_op : cmp::Eq {
|
impl init_op : cmp::Eq {
|
||||||
pure fn eq(other: &init_op) -> bool {
|
pure fn eq(other: &init_op) -> bool {
|
||||||
match self {
|
match self {
|
||||||
@ -938,20 +648,6 @@ type field = spanned<field_>;
|
|||||||
#[auto_serialize]
|
#[auto_serialize]
|
||||||
enum blk_check_mode { default_blk, unsafe_blk, }
|
enum blk_check_mode { default_blk, unsafe_blk, }
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl blk_check_mode : cmp::Eq {
|
|
||||||
pure fn eq(&&other: blk_check_mode) -> bool {
|
|
||||||
match (self, other) {
|
|
||||||
(default_blk, default_blk) => true,
|
|
||||||
(unsafe_blk, unsafe_blk) => true,
|
|
||||||
(default_blk, _) => false,
|
|
||||||
(unsafe_blk, _) => false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: blk_check_mode) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl blk_check_mode : cmp::Eq {
|
impl blk_check_mode : cmp::Eq {
|
||||||
pure fn eq(other: &blk_check_mode) -> bool {
|
pure fn eq(other: &blk_check_mode) -> bool {
|
||||||
match (self, (*other)) {
|
match (self, (*other)) {
|
||||||
@ -1171,36 +867,6 @@ enum lit_ {
|
|||||||
lit_bool(bool),
|
lit_bool(bool),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl ast::lit_: cmp::Eq {
|
|
||||||
pure fn eq(&&other: ast::lit_) -> bool {
|
|
||||||
match (self, other) {
|
|
||||||
(lit_str(a), lit_str(b)) => a == b,
|
|
||||||
(lit_int(val_a, ty_a), lit_int(val_b, ty_b)) => {
|
|
||||||
val_a == val_b && ty_a == ty_b
|
|
||||||
}
|
|
||||||
(lit_uint(val_a, ty_a), lit_uint(val_b, ty_b)) => {
|
|
||||||
val_a == val_b && ty_a == ty_b
|
|
||||||
}
|
|
||||||
(lit_int_unsuffixed(a), lit_int_unsuffixed(b)) => a == b,
|
|
||||||
(lit_float(val_a, ty_a), lit_float(val_b, ty_b)) => {
|
|
||||||
val_a == val_b && ty_a == ty_b
|
|
||||||
}
|
|
||||||
(lit_nil, lit_nil) => true,
|
|
||||||
(lit_bool(a), lit_bool(b)) => a == b,
|
|
||||||
(lit_str(_), _) => false,
|
|
||||||
(lit_int(*), _) => false,
|
|
||||||
(lit_uint(*), _) => false,
|
|
||||||
(lit_int_unsuffixed(*), _) => false,
|
|
||||||
(lit_float(*), _) => false,
|
|
||||||
(lit_nil, _) => false,
|
|
||||||
(lit_bool(_), _) => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: ast::lit_) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl ast::lit_: cmp::Eq {
|
impl ast::lit_: cmp::Eq {
|
||||||
pure fn eq(other: &ast::lit_) -> bool {
|
pure fn eq(other: &ast::lit_) -> bool {
|
||||||
match (self, *other) {
|
match (self, *other) {
|
||||||
@ -1263,28 +929,6 @@ impl int_ty : to_bytes::IterBytes {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl int_ty: cmp::Eq {
|
|
||||||
pure fn eq(&&other: int_ty) -> bool {
|
|
||||||
match (self, other) {
|
|
||||||
(ty_i, ty_i) => true,
|
|
||||||
(ty_char, ty_char) => true,
|
|
||||||
(ty_i8, ty_i8) => true,
|
|
||||||
(ty_i16, ty_i16) => true,
|
|
||||||
(ty_i32, ty_i32) => true,
|
|
||||||
(ty_i64, ty_i64) => true,
|
|
||||||
(ty_i, _) => false,
|
|
||||||
(ty_char, _) => false,
|
|
||||||
(ty_i8, _) => false,
|
|
||||||
(ty_i16, _) => false,
|
|
||||||
(ty_i32, _) => false,
|
|
||||||
(ty_i64, _) => false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: int_ty) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl int_ty : cmp::Eq {
|
impl int_ty : cmp::Eq {
|
||||||
pure fn eq(other: &int_ty) -> bool {
|
pure fn eq(other: &int_ty) -> bool {
|
||||||
match (self, (*other)) {
|
match (self, (*other)) {
|
||||||
@ -1314,26 +958,6 @@ impl uint_ty : to_bytes::IterBytes {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl uint_ty: cmp::Eq {
|
|
||||||
pure fn eq(&&other: uint_ty) -> bool {
|
|
||||||
match (self, other) {
|
|
||||||
(ty_u, ty_u) => true,
|
|
||||||
(ty_u8, ty_u8) => true,
|
|
||||||
(ty_u16, ty_u16) => true,
|
|
||||||
(ty_u32, ty_u32) => true,
|
|
||||||
(ty_u64, ty_u64) => true,
|
|
||||||
(ty_u, _) => false,
|
|
||||||
(ty_u8, _) => false,
|
|
||||||
(ty_u16, _) => false,
|
|
||||||
(ty_u32, _) => false,
|
|
||||||
(ty_u64, _) => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: uint_ty) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl uint_ty : cmp::Eq {
|
impl uint_ty : cmp::Eq {
|
||||||
pure fn eq(other: &uint_ty) -> bool {
|
pure fn eq(other: &uint_ty) -> bool {
|
||||||
match (self, (*other)) {
|
match (self, (*other)) {
|
||||||
@ -1360,18 +984,6 @@ impl float_ty : to_bytes::IterBytes {
|
|||||||
(self as u8).iter_bytes(lsb0, f)
|
(self as u8).iter_bytes(lsb0, f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[cfg(stage0)]
|
|
||||||
impl float_ty: cmp::Eq {
|
|
||||||
pure fn eq(&&other: float_ty) -> bool {
|
|
||||||
match (self, other) {
|
|
||||||
(ty_f, ty_f) | (ty_f32, ty_f32) | (ty_f64, ty_f64) => true,
|
|
||||||
(ty_f, _) | (ty_f32, _) | (ty_f64, _) => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: float_ty) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl float_ty : cmp::Eq {
|
impl float_ty : cmp::Eq {
|
||||||
pure fn eq(other: &float_ty) -> bool {
|
pure fn eq(other: &float_ty) -> bool {
|
||||||
match (self, (*other)) {
|
match (self, (*other)) {
|
||||||
@ -1395,46 +1007,6 @@ enum prim_ty {
|
|||||||
ty_bool,
|
ty_bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl prim_ty : cmp::Eq {
|
|
||||||
pure fn eq(&&other: prim_ty) -> bool {
|
|
||||||
match self {
|
|
||||||
ty_int(e0a) => {
|
|
||||||
match other {
|
|
||||||
ty_int(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_uint(e0a) => {
|
|
||||||
match other {
|
|
||||||
ty_uint(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_float(e0a) => {
|
|
||||||
match other {
|
|
||||||
ty_float(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_str => {
|
|
||||||
match other {
|
|
||||||
ty_str => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_bool => {
|
|
||||||
match other {
|
|
||||||
ty_bool => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: prim_ty) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl prim_ty : cmp::Eq {
|
impl prim_ty : cmp::Eq {
|
||||||
pure fn eq(other: &prim_ty) -> bool {
|
pure fn eq(other: &prim_ty) -> bool {
|
||||||
match self {
|
match self {
|
||||||
@ -1507,17 +1079,6 @@ enum ty_ {
|
|||||||
|
|
||||||
// Equality and byte-iter (hashing) can be quite approximate for AST types.
|
// Equality and byte-iter (hashing) can be quite approximate for AST types.
|
||||||
// since we only care about this for normalizing them to "real" types.
|
// since we only care about this for normalizing them to "real" types.
|
||||||
#[cfg(stage0)]
|
|
||||||
impl ty : cmp::Eq {
|
|
||||||
pure fn eq(&&other: ty) -> bool {
|
|
||||||
ptr::addr_of(self) == ptr::addr_of(other)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: ty) -> bool {
|
|
||||||
ptr::addr_of(self) != ptr::addr_of(other)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl ty : cmp::Eq {
|
impl ty : cmp::Eq {
|
||||||
pure fn eq(other: &ty) -> bool {
|
pure fn eq(other: &ty) -> bool {
|
||||||
ptr::addr_of(self) == ptr::addr_of((*other))
|
ptr::addr_of(self) == ptr::addr_of((*other))
|
||||||
@ -1557,15 +1118,6 @@ impl purity : to_bytes::IterBytes {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl purity : cmp::Eq {
|
|
||||||
pure fn eq(&&other: purity) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: purity) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl purity : cmp::Eq {
|
impl purity : cmp::Eq {
|
||||||
pure fn eq(other: &purity) -> bool {
|
pure fn eq(other: &purity) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
@ -1586,20 +1138,6 @@ impl ret_style : to_bytes::IterBytes {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl ret_style : cmp::Eq {
|
|
||||||
pure fn eq(&&other: ret_style) -> bool {
|
|
||||||
match (self, other) {
|
|
||||||
(noreturn, noreturn) => true,
|
|
||||||
(return_val, return_val) => true,
|
|
||||||
(noreturn, _) => false,
|
|
||||||
(return_val, _) => false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: ret_style) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl ret_style : cmp::Eq {
|
impl ret_style : cmp::Eq {
|
||||||
pure fn eq(other: &ret_style) -> bool {
|
pure fn eq(other: &ret_style) -> bool {
|
||||||
match (self, (*other)) {
|
match (self, (*other)) {
|
||||||
@ -1622,52 +1160,6 @@ enum self_ty_ {
|
|||||||
sty_uniq(mutability) // by-unique-pointer self: `~self`
|
sty_uniq(mutability) // by-unique-pointer self: `~self`
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl self_ty_ : cmp::Eq {
|
|
||||||
pure fn eq(&&other: self_ty_) -> bool {
|
|
||||||
match self {
|
|
||||||
sty_static => {
|
|
||||||
match other {
|
|
||||||
sty_static => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sty_by_ref => {
|
|
||||||
match other {
|
|
||||||
sty_by_ref => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sty_value => {
|
|
||||||
match other {
|
|
||||||
sty_value => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sty_region(e0a) => {
|
|
||||||
match other {
|
|
||||||
sty_region(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sty_box(e0a) => {
|
|
||||||
match other {
|
|
||||||
sty_box(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sty_uniq(e0a) => {
|
|
||||||
match other {
|
|
||||||
sty_uniq(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: self_ty_) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl self_ty_ : cmp::Eq {
|
impl self_ty_ : cmp::Eq {
|
||||||
pure fn eq(other: &self_ty_) -> bool {
|
pure fn eq(other: &self_ty_) -> bool {
|
||||||
match self {
|
match self {
|
||||||
@ -1736,15 +1228,6 @@ enum foreign_abi {
|
|||||||
#[auto_serialize]
|
#[auto_serialize]
|
||||||
enum foreign_mod_sort { named, anonymous }
|
enum foreign_mod_sort { named, anonymous }
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl foreign_mod_sort : cmp::Eq {
|
|
||||||
pure fn eq(&&other: foreign_mod_sort) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: foreign_mod_sort) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl foreign_mod_sort : cmp::Eq {
|
impl foreign_mod_sort : cmp::Eq {
|
||||||
pure fn eq(other: &foreign_mod_sort) -> bool {
|
pure fn eq(other: &foreign_mod_sort) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
@ -1752,22 +1235,6 @@ impl foreign_mod_sort : cmp::Eq {
|
|||||||
pure fn ne(other: &foreign_mod_sort) -> bool { !self.eq(other) }
|
pure fn ne(other: &foreign_mod_sort) -> bool { !self.eq(other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl foreign_abi : cmp::Eq {
|
|
||||||
pure fn eq(&&other: foreign_abi) -> bool {
|
|
||||||
match (self, other) {
|
|
||||||
(foreign_abi_rust_intrinsic, foreign_abi_rust_intrinsic) => true,
|
|
||||||
(foreign_abi_cdecl, foreign_abi_cdecl) => true,
|
|
||||||
(foreign_abi_stdcall, foreign_abi_stdcall) => true,
|
|
||||||
(foreign_abi_rust_intrinsic, _) => false,
|
|
||||||
(foreign_abi_cdecl, _) => false,
|
|
||||||
(foreign_abi_stdcall, _) => false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: foreign_abi) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl foreign_abi : cmp::Eq {
|
impl foreign_abi : cmp::Eq {
|
||||||
pure fn eq(other: &foreign_abi) -> bool {
|
pure fn eq(other: &foreign_abi) -> bool {
|
||||||
match (self, (*other)) {
|
match (self, (*other)) {
|
||||||
@ -1817,15 +1284,6 @@ type path_list_ident = spanned<path_list_ident_>;
|
|||||||
#[auto_serialize]
|
#[auto_serialize]
|
||||||
enum namespace { module_ns, type_value_ns }
|
enum namespace { module_ns, type_value_ns }
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl namespace : cmp::Eq {
|
|
||||||
pure fn eq(&&other: namespace) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: namespace) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl namespace : cmp::Eq {
|
impl namespace : cmp::Eq {
|
||||||
pure fn eq(other: &namespace) -> bool {
|
pure fn eq(other: &namespace) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
@ -1874,15 +1332,6 @@ type attribute = spanned<attribute_>;
|
|||||||
#[auto_serialize]
|
#[auto_serialize]
|
||||||
enum attr_style { attr_outer, attr_inner, }
|
enum attr_style { attr_outer, attr_inner, }
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl attr_style : cmp::Eq {
|
|
||||||
pure fn eq(&&other: attr_style) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: attr_style) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl attr_style : cmp::Eq {
|
impl attr_style : cmp::Eq {
|
||||||
pure fn eq(other: &attr_style) -> bool {
|
pure fn eq(other: &attr_style) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
@ -1909,22 +1358,6 @@ type trait_ref = {path: @path, ref_id: node_id, impl_id: node_id};
|
|||||||
#[auto_serialize]
|
#[auto_serialize]
|
||||||
enum visibility { public, private, inherited }
|
enum visibility { public, private, inherited }
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl visibility : cmp::Eq {
|
|
||||||
pure fn eq(&&other: visibility) -> bool {
|
|
||||||
match (self, other) {
|
|
||||||
(public, public) => true,
|
|
||||||
(private, private) => true,
|
|
||||||
(inherited, inherited) => true,
|
|
||||||
(public, _) => false,
|
|
||||||
(private, _) => false,
|
|
||||||
(inherited, _) => false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: visibility) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl visibility : cmp::Eq {
|
impl visibility : cmp::Eq {
|
||||||
pure fn eq(other: &visibility) -> bool {
|
pure fn eq(other: &visibility) -> bool {
|
||||||
match (self, (*other)) {
|
match (self, (*other)) {
|
||||||
@ -2002,20 +1435,6 @@ impl class_mutability : to_bytes::IterBytes {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl class_mutability : cmp::Eq {
|
|
||||||
pure fn eq(&&other: class_mutability) -> bool {
|
|
||||||
match (self, other) {
|
|
||||||
(class_mutable, class_mutable) => true,
|
|
||||||
(class_immutable, class_immutable) => true,
|
|
||||||
(class_mutable, _) => false,
|
|
||||||
(class_immutable, _) => false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: class_mutability) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl class_mutability : cmp::Eq {
|
impl class_mutability : cmp::Eq {
|
||||||
pure fn eq(other: &class_mutability) -> bool {
|
pure fn eq(other: &class_mutability) -> bool {
|
||||||
match (self, (*other)) {
|
match (self, (*other)) {
|
||||||
|
@ -11,28 +11,6 @@ enum path_elt {
|
|||||||
path_name(ident)
|
path_name(ident)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl path_elt : cmp::Eq {
|
|
||||||
pure fn eq(&&other: path_elt) -> bool {
|
|
||||||
match self {
|
|
||||||
path_mod(e0a) => {
|
|
||||||
match other {
|
|
||||||
path_mod(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
path_name(e0a) => {
|
|
||||||
match other {
|
|
||||||
path_name(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: path_elt) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl path_elt : cmp::Eq {
|
impl path_elt : cmp::Eq {
|
||||||
pure fn eq(other: &path_elt) -> bool {
|
pure fn eq(other: &path_elt) -> bool {
|
||||||
match self {
|
match self {
|
||||||
|
@ -337,15 +337,6 @@ enum inline_attr {
|
|||||||
ia_never,
|
ia_never,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl inline_attr : cmp::Eq {
|
|
||||||
pure fn eq(&&other: inline_attr) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: inline_attr) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl inline_attr : cmp::Eq {
|
impl inline_attr : cmp::Eq {
|
||||||
pure fn eq(other: &inline_attr) -> bool {
|
pure fn eq(other: &inline_attr) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
|
@ -32,15 +32,6 @@ type filename = ~str;
|
|||||||
|
|
||||||
type file_pos = {ch: uint, byte: uint};
|
type file_pos = {ch: uint, byte: uint};
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl file_pos: cmp::Eq {
|
|
||||||
pure fn eq(&&other: file_pos) -> bool {
|
|
||||||
self.ch == other.ch && self.byte == other.byte
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: file_pos) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl file_pos : cmp::Eq {
|
impl file_pos : cmp::Eq {
|
||||||
pure fn eq(other: &file_pos) -> bool {
|
pure fn eq(other: &file_pos) -> bool {
|
||||||
self.ch == (*other).ch && self.byte == (*other).byte
|
self.ch == (*other).ch && self.byte == (*other).byte
|
||||||
@ -180,15 +171,6 @@ type expn_info = Option<@expn_info_>;
|
|||||||
|
|
||||||
type span = {lo: uint, hi: uint, expn_info: expn_info};
|
type span = {lo: uint, hi: uint, expn_info: expn_info};
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl span : cmp::Eq {
|
|
||||||
pure fn eq(&&other: span) -> bool {
|
|
||||||
return self.lo == other.lo && self.hi == other.hi;
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: span) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl span : cmp::Eq {
|
impl span : cmp::Eq {
|
||||||
pure fn eq(other: &span) -> bool {
|
pure fn eq(other: &span) -> bool {
|
||||||
return self.lo == (*other).lo && self.hi == (*other).hi;
|
return self.lo == (*other).lo && self.hi == (*other).hi;
|
||||||
|
@ -146,15 +146,6 @@ enum level {
|
|||||||
note,
|
note,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl level : cmp::Eq {
|
|
||||||
pure fn eq(&&other: level) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: level) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl level : cmp::Eq {
|
impl level : cmp::Eq {
|
||||||
pure fn eq(other: &level) -> bool {
|
pure fn eq(other: &level) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
|
@ -5,20 +5,6 @@ use ast_builder::{path, append_types};
|
|||||||
|
|
||||||
enum direction { send, recv }
|
enum direction { send, recv }
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl direction : cmp::Eq {
|
|
||||||
pure fn eq(&&other: direction) -> bool {
|
|
||||||
match (self, other) {
|
|
||||||
(send, send) => true,
|
|
||||||
(recv, recv) => true,
|
|
||||||
(send, _) => false,
|
|
||||||
(recv, _) => false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: direction) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl direction : cmp::Eq {
|
impl direction : cmp::Eq {
|
||||||
pure fn eq(other: &direction) -> bool {
|
pure fn eq(other: &direction) -> bool {
|
||||||
match (self, (*other)) {
|
match (self, (*other)) {
|
||||||
|
@ -17,17 +17,6 @@ enum cmnt_style {
|
|||||||
blank_line, // Just a manual blank line "\n\n", for layout
|
blank_line, // Just a manual blank line "\n\n", for layout
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl cmnt_style : cmp::Eq {
|
|
||||||
pure fn eq(&&other: cmnt_style) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: cmnt_style) -> bool {
|
|
||||||
(self as uint) != (other as uint)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl cmnt_style : cmp::Eq {
|
impl cmnt_style : cmp::Eq {
|
||||||
pure fn eq(other: &cmnt_style) -> bool {
|
pure fn eq(other: &cmnt_style) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
|
@ -25,17 +25,6 @@ pub enum ObsoleteSyntax {
|
|||||||
ObsoleteModeInFnType
|
ObsoleteModeInFnType
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl ObsoleteSyntax : cmp::Eq {
|
|
||||||
pure fn eq(&&other: ObsoleteSyntax) -> bool {
|
|
||||||
self as uint == other as uint
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: ObsoleteSyntax) -> bool {
|
|
||||||
!self.eq(other)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl ObsoleteSyntax : cmp::Eq {
|
impl ObsoleteSyntax : cmp::Eq {
|
||||||
pure fn eq(other: &ObsoleteSyntax) -> bool {
|
pure fn eq(other: &ObsoleteSyntax) -> bool {
|
||||||
self as uint == (*other) as uint
|
self as uint == (*other) as uint
|
||||||
|
@ -3657,15 +3657,6 @@ impl parser {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl restriction : cmp::Eq {
|
|
||||||
pure fn eq(&&other: restriction) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: restriction) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl restriction : cmp::Eq {
|
impl restriction : cmp::Eq {
|
||||||
pure fn eq(other: &restriction) -> bool {
|
pure fn eq(other: &restriction) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
|
@ -436,15 +436,6 @@ fn reserved_keyword_table() -> HashMap<~str, ()> {
|
|||||||
words
|
words
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl binop : cmp::Eq {
|
|
||||||
pure fn eq(&&other: binop) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: binop) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl binop : cmp::Eq {
|
impl binop : cmp::Eq {
|
||||||
pure fn eq(other: &binop) -> bool {
|
pure fn eq(other: &binop) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
@ -452,274 +443,6 @@ impl binop : cmp::Eq {
|
|||||||
pure fn ne(other: &binop) -> bool { !self.eq(other) }
|
pure fn ne(other: &binop) -> bool { !self.eq(other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl token : cmp::Eq {
|
|
||||||
pure fn eq(&&other: token) -> bool {
|
|
||||||
match self {
|
|
||||||
EQ => {
|
|
||||||
match other {
|
|
||||||
EQ => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LT => {
|
|
||||||
match other {
|
|
||||||
LT => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LE => {
|
|
||||||
match other {
|
|
||||||
LE => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
EQEQ => {
|
|
||||||
match other {
|
|
||||||
EQEQ => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
NE => {
|
|
||||||
match other {
|
|
||||||
NE => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GE => {
|
|
||||||
match other {
|
|
||||||
GE => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
GT => {
|
|
||||||
match other {
|
|
||||||
GT => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ANDAND => {
|
|
||||||
match other {
|
|
||||||
ANDAND => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
OROR => {
|
|
||||||
match other {
|
|
||||||
OROR => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
NOT => {
|
|
||||||
match other {
|
|
||||||
NOT => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TILDE => {
|
|
||||||
match other {
|
|
||||||
TILDE => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
BINOP(e0a) => {
|
|
||||||
match other {
|
|
||||||
BINOP(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
BINOPEQ(e0a) => {
|
|
||||||
match other {
|
|
||||||
BINOPEQ(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AT => {
|
|
||||||
match other {
|
|
||||||
AT => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
DOT => {
|
|
||||||
match other {
|
|
||||||
DOT => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
DOTDOT => {
|
|
||||||
match other {
|
|
||||||
DOTDOT => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ELLIPSIS => {
|
|
||||||
match other {
|
|
||||||
ELLIPSIS => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
COMMA => {
|
|
||||||
match other {
|
|
||||||
COMMA => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
SEMI => {
|
|
||||||
match other {
|
|
||||||
SEMI => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
COLON => {
|
|
||||||
match other {
|
|
||||||
COLON => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MOD_SEP => {
|
|
||||||
match other {
|
|
||||||
MOD_SEP => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
RARROW => {
|
|
||||||
match other {
|
|
||||||
RARROW => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LARROW => {
|
|
||||||
match other {
|
|
||||||
LARROW => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
DARROW => {
|
|
||||||
match other {
|
|
||||||
DARROW => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FAT_ARROW => {
|
|
||||||
match other {
|
|
||||||
FAT_ARROW => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LPAREN => {
|
|
||||||
match other {
|
|
||||||
LPAREN => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
RPAREN => {
|
|
||||||
match other {
|
|
||||||
RPAREN => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LBRACKET => {
|
|
||||||
match other {
|
|
||||||
LBRACKET => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
RBRACKET => {
|
|
||||||
match other {
|
|
||||||
RBRACKET => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LBRACE => {
|
|
||||||
match other {
|
|
||||||
LBRACE => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
RBRACE => {
|
|
||||||
match other {
|
|
||||||
RBRACE => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
POUND => {
|
|
||||||
match other {
|
|
||||||
POUND => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
DOLLAR => {
|
|
||||||
match other {
|
|
||||||
DOLLAR => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LIT_INT(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
LIT_INT(e0b, e1b) => e0a == e0b && e1a == e1b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LIT_UINT(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
LIT_UINT(e0b, e1b) => e0a == e0b && e1a == e1b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LIT_INT_UNSUFFIXED(e0a) => {
|
|
||||||
match other {
|
|
||||||
LIT_INT_UNSUFFIXED(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LIT_FLOAT(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
LIT_FLOAT(e0b, e1b) => e0a == e0b && e1a == e1b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LIT_STR(e0a) => {
|
|
||||||
match other {
|
|
||||||
LIT_STR(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
IDENT(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
IDENT(e0b, e1b) => e0a == e0b && e1a == e1b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
UNDERSCORE => {
|
|
||||||
match other {
|
|
||||||
UNDERSCORE => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
INTERPOLATED(_) => {
|
|
||||||
match other {
|
|
||||||
INTERPOLATED(_) => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
DOC_COMMENT(e0a) => {
|
|
||||||
match other {
|
|
||||||
DOC_COMMENT(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
EOF => {
|
|
||||||
match other {
|
|
||||||
EOF => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: token) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl token : cmp::Eq {
|
impl token : cmp::Eq {
|
||||||
pure fn eq(other: &token) -> bool {
|
pure fn eq(other: &token) -> bool {
|
||||||
match self {
|
match self {
|
||||||
|
@ -55,20 +55,6 @@ use dvec::DVec;
|
|||||||
*/
|
*/
|
||||||
enum breaks { consistent, inconsistent, }
|
enum breaks { consistent, inconsistent, }
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl breaks : cmp::Eq {
|
|
||||||
pure fn eq(&&other: breaks) -> bool {
|
|
||||||
match (self, other) {
|
|
||||||
(consistent, consistent) => true,
|
|
||||||
(inconsistent, inconsistent) => true,
|
|
||||||
(consistent, _) => false,
|
|
||||||
(inconsistent, _) => false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: breaks) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl breaks : cmp::Eq {
|
impl breaks : cmp::Eq {
|
||||||
pure fn eq(other: &breaks) -> bool {
|
pure fn eq(other: &breaks) -> bool {
|
||||||
match (self, (*other)) {
|
match (self, (*other)) {
|
||||||
|
@ -26,15 +26,6 @@ enum output_type {
|
|||||||
output_type_exe,
|
output_type_exe,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl output_type : cmp::Eq {
|
|
||||||
pure fn eq(&&other: output_type) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: output_type) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl output_type : cmp::Eq {
|
impl output_type : cmp::Eq {
|
||||||
pure fn eq(other: &output_type) -> bool {
|
pure fn eq(other: &output_type) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
|
@ -138,15 +138,6 @@ enum compile_upto {
|
|||||||
cu_everything,
|
cu_everything,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl compile_upto : cmp::Eq {
|
|
||||||
pure fn eq(&&other: compile_upto) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: compile_upto) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl compile_upto : cmp::Eq {
|
impl compile_upto : cmp::Eq {
|
||||||
pure fn eq(other: &compile_upto) -> bool {
|
pure fn eq(other: &compile_upto) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
|
@ -207,15 +207,6 @@ enum monitor_msg {
|
|||||||
done,
|
done,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl monitor_msg : cmp::Eq {
|
|
||||||
pure fn eq(&&other: monitor_msg) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: monitor_msg) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl monitor_msg : cmp::Eq {
|
impl monitor_msg : cmp::Eq {
|
||||||
pure fn eq(other: &monitor_msg) -> bool {
|
pure fn eq(other: &monitor_msg) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
|
@ -12,15 +12,6 @@ use middle::lint;
|
|||||||
|
|
||||||
enum os { os_win32, os_macos, os_linux, os_freebsd, }
|
enum os { os_win32, os_macos, os_linux, os_freebsd, }
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl os : cmp::Eq {
|
|
||||||
pure fn eq(&&other: os) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: os) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl os : cmp::Eq {
|
impl os : cmp::Eq {
|
||||||
pure fn eq(other: &os) -> bool {
|
pure fn eq(other: &os) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
@ -30,15 +21,6 @@ impl os : cmp::Eq {
|
|||||||
|
|
||||||
enum arch { arch_x86, arch_x86_64, arch_arm, }
|
enum arch { arch_x86, arch_x86_64, arch_arm, }
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl arch: cmp::Eq {
|
|
||||||
pure fn eq(&&other: arch) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: arch) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl arch : cmp::Eq {
|
impl arch : cmp::Eq {
|
||||||
pure fn eq(other: &arch) -> bool {
|
pure fn eq(other: &arch) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
@ -112,15 +94,6 @@ enum OptLevel {
|
|||||||
Aggressive // -O3
|
Aggressive // -O3
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl OptLevel : cmp::Eq {
|
|
||||||
pure fn eq(&&other: OptLevel) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: OptLevel) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl OptLevel : cmp::Eq {
|
impl OptLevel : cmp::Eq {
|
||||||
pure fn eq(other: &OptLevel) -> bool {
|
pure fn eq(other: &OptLevel) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
|
@ -128,48 +128,6 @@ enum TypeKind {
|
|||||||
X86_MMX = 15
|
X86_MMX = 15
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl TypeKind : cmp::Eq {
|
|
||||||
pure fn eq(&&other: TypeKind) -> bool {
|
|
||||||
match (self, other) {
|
|
||||||
(Void, Void) => true,
|
|
||||||
(Half, Half) => true,
|
|
||||||
(Float, Float) => true,
|
|
||||||
(Double, Double) => true,
|
|
||||||
(X86_FP80, X86_FP80) => true,
|
|
||||||
(FP128, FP128) => true,
|
|
||||||
(PPC_FP128, PPC_FP128) => true,
|
|
||||||
(Label, Label) => true,
|
|
||||||
(Integer, Integer) => true,
|
|
||||||
(Function, Function) => true,
|
|
||||||
(Struct, Struct) => true,
|
|
||||||
(Array, Array) => true,
|
|
||||||
(Pointer, Pointer) => true,
|
|
||||||
(Vector, Vector) => true,
|
|
||||||
(Metadata, Metadata) => true,
|
|
||||||
(X86_MMX, X86_MMX) => true,
|
|
||||||
(Void, _) => false,
|
|
||||||
(Half, _) => false,
|
|
||||||
(Float, _) => false,
|
|
||||||
(Double, _) => false,
|
|
||||||
(X86_FP80, _) => false,
|
|
||||||
(FP128, _) => false,
|
|
||||||
(PPC_FP128, _) => false,
|
|
||||||
(Label, _) => false,
|
|
||||||
(Integer, _) => false,
|
|
||||||
(Function, _) => false,
|
|
||||||
(Struct, _) => false,
|
|
||||||
(Array, _) => false,
|
|
||||||
(Pointer, _) => false,
|
|
||||||
(Vector, _) => false,
|
|
||||||
(Metadata, _) => false,
|
|
||||||
(X86_MMX, _) => false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: TypeKind) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl TypeKind : cmp::Eq {
|
impl TypeKind : cmp::Eq {
|
||||||
pure fn eq(other: &TypeKind) -> bool {
|
pure fn eq(other: &TypeKind) -> bool {
|
||||||
match (self, (*other)) {
|
match (self, (*other)) {
|
||||||
|
@ -129,15 +129,6 @@ enum Family {
|
|||||||
InheritedField // N
|
InheritedField // N
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl Family : cmp::Eq {
|
|
||||||
pure fn eq(&&other: Family) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: Family) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl Family : cmp::Eq {
|
impl Family : cmp::Eq {
|
||||||
pure fn eq(other: &Family) -> bool {
|
pure fn eq(other: &Family) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
|
@ -323,53 +323,6 @@ enum bckerr_code {
|
|||||||
err_out_of_scope(ty::region, ty::region) // superscope, subscope
|
err_out_of_scope(ty::region, ty::region) // superscope, subscope
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl bckerr_code : cmp::Eq {
|
|
||||||
pure fn eq(&&other: bckerr_code) -> bool {
|
|
||||||
match self {
|
|
||||||
err_mut_uniq => {
|
|
||||||
match other {
|
|
||||||
err_mut_uniq => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
err_mut_variant => {
|
|
||||||
match other {
|
|
||||||
err_mut_variant => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
err_root_not_permitted => {
|
|
||||||
match other {
|
|
||||||
err_root_not_permitted => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
err_mutbl(e0a) => {
|
|
||||||
match other {
|
|
||||||
err_mutbl(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
err_out_of_root_scope(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
err_out_of_root_scope(e0b, e1b) =>
|
|
||||||
e0a == e0b && e1a == e1b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
err_out_of_scope(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
err_out_of_scope(e0b, e1b) => e0a == e0b && e1a == e1b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: bckerr_code) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl bckerr_code : cmp::Eq {
|
impl bckerr_code : cmp::Eq {
|
||||||
pure fn eq(other: &bckerr_code) -> bool {
|
pure fn eq(other: &bckerr_code) -> bool {
|
||||||
match self {
|
match self {
|
||||||
@ -419,15 +372,6 @@ impl bckerr_code : cmp::Eq {
|
|||||||
// that caused it
|
// that caused it
|
||||||
type bckerr = {cmt: cmt, code: bckerr_code};
|
type bckerr = {cmt: cmt, code: bckerr_code};
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl bckerr : cmp::Eq {
|
|
||||||
pure fn eq(&&other: bckerr) -> bool {
|
|
||||||
self.cmt == other.cmt && self.code == other.code
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: bckerr) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl bckerr : cmp::Eq {
|
impl bckerr : cmp::Eq {
|
||||||
pure fn eq(other: &bckerr) -> bool {
|
pure fn eq(other: &bckerr) -> bool {
|
||||||
self.cmt == (*other).cmt && self.code == (*other).code
|
self.cmt == (*other).cmt && self.code == (*other).code
|
||||||
@ -461,17 +405,6 @@ fn save_and_restore<T:Copy,U>(&save_and_restore_t: T, f: fn() -> U) -> U {
|
|||||||
|
|
||||||
/// Creates and returns a new root_map
|
/// Creates and returns a new root_map
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl root_map_key : cmp::Eq {
|
|
||||||
pure fn eq(&&other: root_map_key) -> bool {
|
|
||||||
self.id == other.id && self.derefs == other.derefs
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: root_map_key) -> bool {
|
|
||||||
! (self == other)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl root_map_key : cmp::Eq {
|
impl root_map_key : cmp::Eq {
|
||||||
pure fn eq(other: &root_map_key) -> bool {
|
pure fn eq(other: &root_map_key) -> bool {
|
||||||
self.id == (*other).id && self.derefs == (*other).derefs
|
self.id == (*other).id && self.derefs == (*other).derefs
|
||||||
|
@ -36,28 +36,6 @@ enum purity_cause {
|
|||||||
pc_cmt(bckerr)
|
pc_cmt(bckerr)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl purity_cause : cmp::Eq {
|
|
||||||
pure fn eq(&&other: purity_cause) -> bool {
|
|
||||||
match self {
|
|
||||||
pc_pure_fn => {
|
|
||||||
match other {
|
|
||||||
pc_pure_fn => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pc_cmt(e0a) => {
|
|
||||||
match other {
|
|
||||||
pc_cmt(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: purity_cause) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl purity_cause : cmp::Eq {
|
impl purity_cause : cmp::Eq {
|
||||||
pure fn eq(other: &purity_cause) -> bool {
|
pure fn eq(other: &purity_cause) -> bool {
|
||||||
match self {
|
match self {
|
||||||
@ -100,15 +78,6 @@ enum assignment_type {
|
|||||||
at_swap
|
at_swap
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl assignment_type : cmp::Eq {
|
|
||||||
pure fn eq(&&other: assignment_type) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: assignment_type) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl assignment_type : cmp::Eq {
|
impl assignment_type : cmp::Eq {
|
||||||
pure fn eq(other: &assignment_type) -> bool {
|
pure fn eq(other: &assignment_type) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
|
@ -124,25 +124,6 @@ enum ctor {
|
|||||||
range(const_val, const_val),
|
range(const_val, const_val),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl ctor: cmp::Eq {
|
|
||||||
pure fn eq(&&other: ctor) -> bool {
|
|
||||||
match (self, other) {
|
|
||||||
(single, single) => true,
|
|
||||||
(variant(did_self), variant(did_other)) => did_self == did_other,
|
|
||||||
(val(cv_self), val(cv_other)) => cv_self == cv_other,
|
|
||||||
(range(cv0_self, cv1_self), range(cv0_other, cv1_other)) => {
|
|
||||||
cv0_self == cv0_other && cv1_self == cv1_other
|
|
||||||
}
|
|
||||||
(single, _) | (variant(_), _) | (val(_), _) | (range(*), _) => {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: ctor) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl ctor : cmp::Eq {
|
impl ctor : cmp::Eq {
|
||||||
pure fn eq(other: &ctor) -> bool {
|
pure fn eq(other: &ctor) -> bool {
|
||||||
match (self, (*other)) {
|
match (self, (*other)) {
|
||||||
|
@ -189,23 +189,6 @@ enum const_val {
|
|||||||
const_bool(bool)
|
const_bool(bool)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl const_val: cmp::Eq {
|
|
||||||
pure fn eq(&&other: const_val) -> bool {
|
|
||||||
match (self, other) {
|
|
||||||
(const_float(a), const_float(b)) => a == b,
|
|
||||||
(const_int(a), const_int(b)) => a == b,
|
|
||||||
(const_uint(a), const_uint(b)) => a == b,
|
|
||||||
(const_str(a), const_str(b)) => a == b,
|
|
||||||
(const_bool(a), const_bool(b)) => a == b,
|
|
||||||
(const_float(_), _) | (const_int(_), _) | (const_uint(_), _) |
|
|
||||||
(const_str(_), _) | (const_bool(_), _) => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: const_val) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl const_val : cmp::Eq {
|
impl const_val : cmp::Eq {
|
||||||
pure fn eq(other: &const_val) -> bool {
|
pure fn eq(other: &const_val) -> bool {
|
||||||
match (self, (*other)) {
|
match (self, (*other)) {
|
||||||
|
@ -66,15 +66,6 @@ enum lint {
|
|||||||
// dead_assignment
|
// dead_assignment
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl lint : cmp::Eq {
|
|
||||||
pure fn eq(&&other: lint) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: lint) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl lint : cmp::Eq {
|
impl lint : cmp::Eq {
|
||||||
pure fn eq(other: &lint) -> bool {
|
pure fn eq(other: &lint) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
@ -95,15 +86,6 @@ enum level {
|
|||||||
allow, warn, deny, forbid
|
allow, warn, deny, forbid
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl level : cmp::Eq {
|
|
||||||
pure fn eq(&&other: level) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: level) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl level : cmp::Eq {
|
impl level : cmp::Eq {
|
||||||
pure fn eq(other: &level) -> bool {
|
pure fn eq(other: &level) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
|
@ -127,25 +127,11 @@ type last_use_map = HashMap<node_id, @DVec<node_id>>;
|
|||||||
enum Variable = uint;
|
enum Variable = uint;
|
||||||
enum LiveNode = uint;
|
enum LiveNode = uint;
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl Variable : cmp::Eq {
|
|
||||||
pure fn eq(&&other: Variable) -> bool { *self == *other }
|
|
||||||
pure fn ne(&&other: Variable) -> bool { *self != *other }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl Variable : cmp::Eq {
|
impl Variable : cmp::Eq {
|
||||||
pure fn eq(other: &Variable) -> bool { *self == *(*other) }
|
pure fn eq(other: &Variable) -> bool { *self == *(*other) }
|
||||||
pure fn ne(other: &Variable) -> bool { *self != *(*other) }
|
pure fn ne(other: &Variable) -> bool { *self != *(*other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl LiveNode : cmp::Eq {
|
|
||||||
pure fn eq(&&other: LiveNode) -> bool { *self == *other }
|
|
||||||
pure fn ne(&&other: LiveNode) -> bool { *self != *other }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl LiveNode : cmp::Eq {
|
impl LiveNode : cmp::Eq {
|
||||||
pure fn eq(other: &LiveNode) -> bool { *self == *(*other) }
|
pure fn eq(other: &LiveNode) -> bool { *self == *(*other) }
|
||||||
pure fn ne(other: &LiveNode) -> bool { *self != *(*other) }
|
pure fn ne(other: &LiveNode) -> bool { *self != *(*other) }
|
||||||
@ -158,40 +144,6 @@ enum LiveNodeKind {
|
|||||||
ExitNode
|
ExitNode
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl LiveNodeKind : cmp::Eq {
|
|
||||||
pure fn eq(&&other: LiveNodeKind) -> bool {
|
|
||||||
match self {
|
|
||||||
FreeVarNode(e0a) => {
|
|
||||||
match other {
|
|
||||||
FreeVarNode(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ExprNode(e0a) => {
|
|
||||||
match other {
|
|
||||||
ExprNode(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
VarDefNode(e0a) => {
|
|
||||||
match other {
|
|
||||||
VarDefNode(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ExitNode => {
|
|
||||||
match other {
|
|
||||||
ExitNode => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: LiveNodeKind) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl LiveNodeKind : cmp::Eq {
|
impl LiveNodeKind : cmp::Eq {
|
||||||
pure fn eq(other: &LiveNodeKind) -> bool {
|
pure fn eq(other: &LiveNodeKind) -> bool {
|
||||||
match self {
|
match self {
|
||||||
|
@ -55,71 +55,6 @@ enum categorization {
|
|||||||
cat_discr(cmt, ast::node_id), // match discriminant (see preserve())
|
cat_discr(cmt, ast::node_id), // match discriminant (see preserve())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl categorization : cmp::Eq {
|
|
||||||
pure fn eq(&&other: categorization) -> bool {
|
|
||||||
match self {
|
|
||||||
cat_rvalue => {
|
|
||||||
match other {
|
|
||||||
cat_rvalue => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cat_special(e0a) => {
|
|
||||||
match other {
|
|
||||||
cat_special(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cat_local(e0a) => {
|
|
||||||
match other {
|
|
||||||
cat_local(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cat_binding(e0a) => {
|
|
||||||
match other {
|
|
||||||
cat_binding(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cat_arg(e0a) => {
|
|
||||||
match other {
|
|
||||||
cat_arg(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cat_stack_upvar(e0a) => {
|
|
||||||
match other {
|
|
||||||
cat_stack_upvar(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cat_deref(e0a, e1a, e2a) => {
|
|
||||||
match other {
|
|
||||||
cat_deref(e0b, e1b, e2b) =>
|
|
||||||
e0a == e0b && e1a == e1b && e2a == e2b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cat_comp(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
cat_comp(e0b, e1b) => e0a == e0b && e1a == e1b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cat_discr(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
cat_discr(e0b, e1b) => e0a == e0b && e1a == e1b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: categorization) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl categorization : cmp::Eq {
|
impl categorization : cmp::Eq {
|
||||||
pure fn eq(other: &categorization) -> bool {
|
pure fn eq(other: &categorization) -> bool {
|
||||||
match self {
|
match self {
|
||||||
@ -191,40 +126,6 @@ enum ptr_kind {
|
|||||||
unsafe_ptr
|
unsafe_ptr
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl ptr_kind : cmp::Eq {
|
|
||||||
pure fn eq(&&other: ptr_kind) -> bool {
|
|
||||||
match self {
|
|
||||||
uniq_ptr => {
|
|
||||||
match other {
|
|
||||||
uniq_ptr => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
gc_ptr => {
|
|
||||||
match other {
|
|
||||||
gc_ptr => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
region_ptr(e0a) => {
|
|
||||||
match other {
|
|
||||||
region_ptr(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
unsafe_ptr => {
|
|
||||||
match other {
|
|
||||||
unsafe_ptr => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: ptr_kind) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl ptr_kind : cmp::Eq {
|
impl ptr_kind : cmp::Eq {
|
||||||
pure fn eq(other: &ptr_kind) -> bool {
|
pure fn eq(other: &ptr_kind) -> bool {
|
||||||
match self {
|
match self {
|
||||||
@ -268,40 +169,6 @@ enum comp_kind {
|
|||||||
ast::mutability) // mutability of vec content
|
ast::mutability) // mutability of vec content
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl comp_kind : cmp::Eq {
|
|
||||||
pure fn eq(&&other: comp_kind) -> bool {
|
|
||||||
match self {
|
|
||||||
comp_tuple => {
|
|
||||||
match other {
|
|
||||||
comp_tuple => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
comp_variant(e0a) => {
|
|
||||||
match other {
|
|
||||||
comp_variant(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
comp_field(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
comp_field(e0b, e1b) => e0a == e0b && e1a == e1b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
comp_index(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
comp_index(e0b, e1b) => e0a == e0b && e1a == e1b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: comp_kind) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl comp_kind : cmp::Eq {
|
impl comp_kind : cmp::Eq {
|
||||||
pure fn eq(other: &comp_kind) -> bool {
|
pure fn eq(other: &comp_kind) -> bool {
|
||||||
match self {
|
match self {
|
||||||
@ -342,15 +209,6 @@ enum special_kind {
|
|||||||
sk_heap_upvar
|
sk_heap_upvar
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl special_kind : cmp::Eq {
|
|
||||||
pure fn eq(&&other: special_kind) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: special_kind) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl special_kind : cmp::Eq {
|
impl special_kind : cmp::Eq {
|
||||||
pure fn eq(other: &special_kind) -> bool {
|
pure fn eq(other: &special_kind) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
@ -370,20 +228,6 @@ type cmt_ = {id: ast::node_id, // id of expr/pat producing this value
|
|||||||
|
|
||||||
type cmt = @cmt_;
|
type cmt = @cmt_;
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl cmt_ : cmp::Eq {
|
|
||||||
pure fn eq(&&other: cmt_) -> bool {
|
|
||||||
self.id == other.id &&
|
|
||||||
self.span == other.span &&
|
|
||||||
self.cat == other.cat &&
|
|
||||||
self.lp == other.lp &&
|
|
||||||
self.mutbl == other.mutbl &&
|
|
||||||
self.ty == other.ty
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: cmt_) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl cmt_ : cmp::Eq {
|
impl cmt_ : cmp::Eq {
|
||||||
pure fn eq(other: &cmt_) -> bool {
|
pure fn eq(other: &cmt_) -> bool {
|
||||||
self.id == (*other).id &&
|
self.id == (*other).id &&
|
||||||
@ -406,40 +250,6 @@ enum loan_path {
|
|||||||
lp_comp(@loan_path, comp_kind)
|
lp_comp(@loan_path, comp_kind)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl loan_path : cmp::Eq {
|
|
||||||
pure fn eq(&&other: loan_path) -> bool {
|
|
||||||
match self {
|
|
||||||
lp_local(e0a) => {
|
|
||||||
match other {
|
|
||||||
lp_local(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lp_arg(e0a) => {
|
|
||||||
match other {
|
|
||||||
lp_arg(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lp_deref(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
lp_deref(e0b, e1b) => e0a == e0b && e1a == e1b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lp_comp(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
lp_comp(e0b, e1b) => e0a == e0b && e1a == e1b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: loan_path) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl loan_path : cmp::Eq {
|
impl loan_path : cmp::Eq {
|
||||||
pure fn eq(other: &loan_path) -> bool {
|
pure fn eq(other: &loan_path) -> bool {
|
||||||
match self {
|
match self {
|
||||||
|
@ -373,15 +373,6 @@ type region_paramd_items = HashMap<ast::node_id, region_variance>;
|
|||||||
type region_dep = {ambient_variance: region_variance, id: ast::node_id};
|
type region_dep = {ambient_variance: region_variance, id: ast::node_id};
|
||||||
type dep_map = HashMap<ast::node_id, @DVec<region_dep>>;
|
type dep_map = HashMap<ast::node_id, @DVec<region_dep>>;
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl region_dep: cmp::Eq {
|
|
||||||
pure fn eq(&&other: region_dep) -> bool {
|
|
||||||
self.ambient_variance == other.ambient_variance && self.id == other.id
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: region_dep) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl region_dep : cmp::Eq {
|
impl region_dep : cmp::Eq {
|
||||||
pure fn eq(other: ®ion_dep) -> bool {
|
pure fn eq(other: ®ion_dep) -> bool {
|
||||||
self.ambient_variance == (*other).ambient_variance &&
|
self.ambient_variance == (*other).ambient_variance &&
|
||||||
|
@ -106,15 +106,6 @@ enum PatternBindingMode {
|
|||||||
IrrefutableMode
|
IrrefutableMode
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl PatternBindingMode : cmp::Eq {
|
|
||||||
pure fn eq(&&other: PatternBindingMode) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: PatternBindingMode) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl PatternBindingMode : cmp::Eq {
|
impl PatternBindingMode : cmp::Eq {
|
||||||
pure fn eq(other: &PatternBindingMode) -> bool {
|
pure fn eq(other: &PatternBindingMode) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
@ -156,15 +147,6 @@ enum Mutability {
|
|||||||
Immutable
|
Immutable
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl Mutability : cmp::Eq {
|
|
||||||
pure fn eq(&&other: Mutability) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: Mutability) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl Mutability : cmp::Eq {
|
impl Mutability : cmp::Eq {
|
||||||
pure fn eq(other: &Mutability) -> bool {
|
pure fn eq(other: &Mutability) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
@ -200,15 +182,6 @@ enum ImportDirectiveNS {
|
|||||||
AnyNS
|
AnyNS
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl ImportDirectiveNS : cmp::Eq {
|
|
||||||
pure fn eq(&&other: ImportDirectiveNS) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: ImportDirectiveNS) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl ImportDirectiveNS : cmp::Eq {
|
impl ImportDirectiveNS : cmp::Eq {
|
||||||
pure fn eq(other: &ImportDirectiveNS) -> bool {
|
pure fn eq(other: &ImportDirectiveNS) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
@ -305,15 +278,6 @@ enum XrayFlag {
|
|||||||
Xray //< Private items can be accessed.
|
Xray //< Private items can be accessed.
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl XrayFlag : cmp::Eq {
|
|
||||||
pure fn eq(&&other: XrayFlag) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: XrayFlag) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl XrayFlag : cmp::Eq {
|
impl XrayFlag : cmp::Eq {
|
||||||
pure fn eq(other: &XrayFlag) -> bool {
|
pure fn eq(other: &XrayFlag) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
@ -326,15 +290,6 @@ enum AllowCapturingSelfFlag {
|
|||||||
DontAllowCapturingSelf, //< The "self" definition cannot be captured.
|
DontAllowCapturingSelf, //< The "self" definition cannot be captured.
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl AllowCapturingSelfFlag : cmp::Eq {
|
|
||||||
pure fn eq(&&other: AllowCapturingSelfFlag) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: AllowCapturingSelfFlag) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl AllowCapturingSelfFlag : cmp::Eq {
|
impl AllowCapturingSelfFlag : cmp::Eq {
|
||||||
pure fn eq(other: &AllowCapturingSelfFlag) -> bool {
|
pure fn eq(other: &AllowCapturingSelfFlag) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
@ -548,15 +503,6 @@ enum Privacy {
|
|||||||
Public
|
Public
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl Privacy : cmp::Eq {
|
|
||||||
pure fn eq(&&other: Privacy) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: Privacy) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl Privacy : cmp::Eq {
|
impl Privacy : cmp::Eq {
|
||||||
pure fn eq(other: &Privacy) -> bool {
|
pure fn eq(other: &Privacy) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
|
@ -675,15 +675,6 @@ fn pick_col(m: &[@Match]) -> uint {
|
|||||||
|
|
||||||
enum branch_kind { no_branch, single, switch, compare, }
|
enum branch_kind { no_branch, single, switch, compare, }
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl branch_kind : cmp::Eq {
|
|
||||||
pure fn eq(&&other: branch_kind) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: branch_kind) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl branch_kind : cmp::Eq {
|
impl branch_kind : cmp::Eq {
|
||||||
pure fn eq(other: &branch_kind) -> bool {
|
pure fn eq(other: &branch_kind) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
|
@ -281,28 +281,6 @@ enum cleanup {
|
|||||||
clean_temp(ValueRef, fn@(block) -> block, cleantype),
|
clean_temp(ValueRef, fn@(block) -> block, cleantype),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl cleantype : cmp::Eq {
|
|
||||||
pure fn eq(&&other: cleantype) -> bool {
|
|
||||||
match self {
|
|
||||||
normal_exit_only => {
|
|
||||||
match other {
|
|
||||||
normal_exit_only => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
normal_exit_and_unwind => {
|
|
||||||
match other {
|
|
||||||
normal_exit_and_unwind => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: cleantype) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl cleantype : cmp::Eq {
|
impl cleantype : cmp::Eq {
|
||||||
pure fn eq(other: &cleantype) -> bool {
|
pure fn eq(other: &cleantype) -> bool {
|
||||||
match self {
|
match self {
|
||||||
@ -1135,28 +1113,6 @@ type mono_id_ = {def: ast::def_id, params: ~[mono_param_id]};
|
|||||||
|
|
||||||
type mono_id = @mono_id_;
|
type mono_id = @mono_id_;
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl mono_param_id: cmp::Eq {
|
|
||||||
pure fn eq(&&other: mono_param_id) -> bool {
|
|
||||||
match (self, other) {
|
|
||||||
(mono_precise(ty_a, ids_a), mono_precise(ty_b, ids_b)) => {
|
|
||||||
ty_a == ty_b && ids_a == ids_b
|
|
||||||
}
|
|
||||||
(mono_any, mono_any) => true,
|
|
||||||
(mono_repr(size_a, align_a, is_float_a, mode_a),
|
|
||||||
mono_repr(size_b, align_b, is_float_b, mode_b)) => {
|
|
||||||
size_a == size_b && align_a == align_b &&
|
|
||||||
is_float_a == is_float_b && mode_a == mode_b
|
|
||||||
}
|
|
||||||
(mono_precise(*), _) => false,
|
|
||||||
(mono_any, _) => false,
|
|
||||||
(mono_repr(*), _) => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: mono_param_id) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl mono_param_id : cmp::Eq {
|
impl mono_param_id : cmp::Eq {
|
||||||
pure fn eq(other: &mono_param_id) -> bool {
|
pure fn eq(other: &mono_param_id) -> bool {
|
||||||
match (self, (*other)) {
|
match (self, (*other)) {
|
||||||
@ -1177,15 +1133,6 @@ impl mono_param_id : cmp::Eq {
|
|||||||
pure fn ne(other: &mono_param_id) -> bool { !self.eq(other) }
|
pure fn ne(other: &mono_param_id) -> bool { !self.eq(other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl mono_id_: cmp::Eq {
|
|
||||||
pure fn eq(&&other: mono_id_) -> bool {
|
|
||||||
return self.def == other.def && self.params == other.params;
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: mono_id_) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl mono_id_ : cmp::Eq {
|
impl mono_id_ : cmp::Eq {
|
||||||
pure fn eq(other: &mono_id_) -> bool {
|
pure fn eq(other: &mono_id_) -> bool {
|
||||||
return self.def == (*other).def && self.params == (*other).params;
|
return self.def == (*other).def && self.params == (*other).params;
|
||||||
|
@ -138,16 +138,6 @@ impl DatumMode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl DatumMode: cmp::Eq {
|
|
||||||
pure fn eq(&&other: DatumMode) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: DatumMode) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl DatumMode: cmp::Eq {
|
impl DatumMode: cmp::Eq {
|
||||||
pure fn eq(other: &DatumMode) -> bool {
|
pure fn eq(other: &DatumMode) -> bool {
|
||||||
self as uint == (*other as uint)
|
self as uint == (*other as uint)
|
||||||
@ -776,20 +766,6 @@ impl DatumBlock {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl CopyAction : cmp::Eq {
|
|
||||||
pure fn eq(&&other: CopyAction) -> bool {
|
|
||||||
match (self, other) {
|
|
||||||
(INIT, INIT) => true,
|
|
||||||
(DROP_EXISTING, DROP_EXISTING) => true,
|
|
||||||
(INIT, _) => false,
|
|
||||||
(DROP_EXISTING, _) => false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: CopyAction) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl CopyAction : cmp::Eq {
|
impl CopyAction : cmp::Eq {
|
||||||
pure fn eq(other: &CopyAction) -> bool {
|
pure fn eq(other: &CopyAction) -> bool {
|
||||||
match (self, (*other)) {
|
match (self, (*other)) {
|
||||||
|
@ -147,20 +147,6 @@ impl Dest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl Dest : cmp::Eq {
|
|
||||||
pure fn eq(&&other: Dest) -> bool {
|
|
||||||
match (self, other) {
|
|
||||||
(SaveIn(e0a), SaveIn(e0b)) => e0a == e0b,
|
|
||||||
(Ignore, Ignore) => true,
|
|
||||||
(SaveIn(*), _) => false,
|
|
||||||
(Ignore, _) => false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: Dest) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl Dest : cmp::Eq {
|
impl Dest : cmp::Eq {
|
||||||
pure fn eq(other: &Dest) -> bool {
|
pure fn eq(other: &Dest) -> bool {
|
||||||
match (self, (*other)) {
|
match (self, (*other)) {
|
||||||
@ -1366,26 +1352,6 @@ enum cast_kind {
|
|||||||
cast_other,
|
cast_other,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl cast_kind : cmp::Eq {
|
|
||||||
pure fn eq(&&other: cast_kind) -> bool {
|
|
||||||
match (self, other) {
|
|
||||||
(cast_pointer, cast_pointer) => true,
|
|
||||||
(cast_integral, cast_integral) => true,
|
|
||||||
(cast_float, cast_float) => true,
|
|
||||||
(cast_enum, cast_enum) => true,
|
|
||||||
(cast_other, cast_other) => true,
|
|
||||||
(cast_pointer, _) => false,
|
|
||||||
(cast_integral, _) => false,
|
|
||||||
(cast_float, _) => false,
|
|
||||||
(cast_enum, _) => false,
|
|
||||||
(cast_other, _) => false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: cast_kind) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl cast_kind : cmp::Eq {
|
impl cast_kind : cmp::Eq {
|
||||||
pure fn eq(other: &cast_kind) -> bool {
|
pure fn eq(other: &cast_kind) -> bool {
|
||||||
match (self, (*other)) {
|
match (self, (*other)) {
|
||||||
|
@ -40,15 +40,6 @@ enum x86_64_reg_class {
|
|||||||
memory_class
|
memory_class
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl x86_64_reg_class: cmp::Eq {
|
|
||||||
pure fn eq(&&other: x86_64_reg_class) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: x86_64_reg_class) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl x86_64_reg_class : cmp::Eq {
|
impl x86_64_reg_class : cmp::Eq {
|
||||||
pure fn eq(other: &x86_64_reg_class) -> bool {
|
pure fn eq(other: &x86_64_reg_class) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
|
@ -26,24 +26,6 @@ type nominal_id_ = {did: ast::def_id, parent_id: Option<ast::def_id>,
|
|||||||
tps: ~[ty::t]};
|
tps: ~[ty::t]};
|
||||||
type nominal_id = @nominal_id_;
|
type nominal_id = @nominal_id_;
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl nominal_id_ : core::cmp::Eq {
|
|
||||||
pure fn eq(&&other: nominal_id_) -> bool {
|
|
||||||
if self.did != other.did ||
|
|
||||||
self.parent_id != other.parent_id {
|
|
||||||
false
|
|
||||||
} else {
|
|
||||||
do vec::all2(self.tps, other.tps) |m_tp, n_tp| {
|
|
||||||
ty::type_id(m_tp) == ty::type_id(n_tp)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: nominal_id_) -> bool {
|
|
||||||
! (self == other)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl nominal_id_ : core::cmp::Eq {
|
impl nominal_id_ : core::cmp::Eq {
|
||||||
pure fn eq(other: &nominal_id_) -> bool {
|
pure fn eq(other: &nominal_id_) -> bool {
|
||||||
if self.did != other.did ||
|
if self.did != other.did ||
|
||||||
|
@ -235,19 +235,6 @@ type field_ty = {
|
|||||||
type creader_cache_key = {cnum: int, pos: uint, len: uint};
|
type creader_cache_key = {cnum: int, pos: uint, len: uint};
|
||||||
type creader_cache = HashMap<creader_cache_key, t>;
|
type creader_cache = HashMap<creader_cache_key, t>;
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl creader_cache_key : cmp::Eq {
|
|
||||||
pure fn eq(&&other: creader_cache_key) -> bool {
|
|
||||||
self.cnum == other.cnum &&
|
|
||||||
self.pos == other.pos &&
|
|
||||||
self.len == other.len
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: creader_cache_key) -> bool {
|
|
||||||
!(self == other)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl creader_cache_key : cmp::Eq {
|
impl creader_cache_key : cmp::Eq {
|
||||||
pure fn eq(other: &creader_cache_key) -> bool {
|
pure fn eq(other: &creader_cache_key) -> bool {
|
||||||
self.cnum == (*other).cnum &&
|
self.cnum == (*other).cnum &&
|
||||||
@ -267,15 +254,6 @@ impl creader_cache_key : to_bytes::IterBytes {
|
|||||||
|
|
||||||
type intern_key = {sty: sty, o_def_id: Option<ast::def_id>};
|
type intern_key = {sty: sty, o_def_id: Option<ast::def_id>};
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl intern_key: cmp::Eq {
|
|
||||||
pure fn eq(&&other: intern_key) -> bool {
|
|
||||||
self.sty == other.sty && self.o_def_id == other.o_def_id
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: intern_key) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl intern_key : cmp::Eq {
|
impl intern_key : cmp::Eq {
|
||||||
pure fn eq(other: &intern_key) -> bool {
|
pure fn eq(other: &intern_key) -> bool {
|
||||||
self.sty == (*other).sty && self.o_def_id == (*other).o_def_id
|
self.sty == (*other).sty && self.o_def_id == (*other).o_def_id
|
||||||
@ -300,22 +278,6 @@ type opt_region_variance = Option<region_variance>;
|
|||||||
#[auto_serialize]
|
#[auto_serialize]
|
||||||
enum region_variance { rv_covariant, rv_invariant, rv_contravariant }
|
enum region_variance { rv_covariant, rv_invariant, rv_contravariant }
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl region_variance: cmp::Eq {
|
|
||||||
pure fn eq(&&other: region_variance) -> bool {
|
|
||||||
match (self, other) {
|
|
||||||
(rv_covariant, rv_covariant) => true,
|
|
||||||
(rv_invariant, rv_invariant) => true,
|
|
||||||
(rv_contravariant, rv_contravariant) => true,
|
|
||||||
(rv_covariant, _) => false,
|
|
||||||
(rv_invariant, _) => false,
|
|
||||||
(rv_contravariant, _) => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: region_variance) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl region_variance : cmp::Eq {
|
impl region_variance : cmp::Eq {
|
||||||
pure fn eq(other: ®ion_variance) -> bool {
|
pure fn eq(other: ®ion_variance) -> bool {
|
||||||
match (self, (*other)) {
|
match (self, (*other)) {
|
||||||
@ -448,15 +410,6 @@ impl closure_kind : to_bytes::IterBytes {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl closure_kind : cmp::Eq {
|
|
||||||
pure fn eq(&&other: closure_kind) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: closure_kind) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl closure_kind : cmp::Eq {
|
impl closure_kind : cmp::Eq {
|
||||||
pure fn eq(other: &closure_kind) -> bool {
|
pure fn eq(other: &closure_kind) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
@ -481,28 +434,6 @@ impl fn_proto : to_bytes::IterBytes {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl fn_proto : cmp::Eq {
|
|
||||||
pure fn eq(&&other: fn_proto) -> bool {
|
|
||||||
match self {
|
|
||||||
proto_bare => {
|
|
||||||
match other {
|
|
||||||
proto_bare => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
proto_vstore(e0a) => {
|
|
||||||
match other {
|
|
||||||
proto_vstore(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: fn_proto) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl fn_proto : cmp::Eq {
|
impl fn_proto : cmp::Eq {
|
||||||
pure fn eq(other: &fn_proto) -> bool {
|
pure fn eq(other: &fn_proto) -> bool {
|
||||||
match self {
|
match self {
|
||||||
@ -562,15 +493,6 @@ type FnTy = FnTyBase<FnMeta>;
|
|||||||
|
|
||||||
type param_ty = {idx: uint, def_id: def_id};
|
type param_ty = {idx: uint, def_id: def_id};
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl param_ty: cmp::Eq {
|
|
||||||
pure fn eq(&&other: param_ty) -> bool {
|
|
||||||
self.idx == other.idx && self.def_id == other.def_id
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: param_ty) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl param_ty : cmp::Eq {
|
impl param_ty : cmp::Eq {
|
||||||
pure fn eq(other: ¶m_ty) -> bool {
|
pure fn eq(other: ¶m_ty) -> bool {
|
||||||
self.idx == (*other).idx && self.def_id == (*other).def_id
|
self.idx == (*other).idx && self.def_id == (*other).def_id
|
||||||
@ -1894,16 +1816,6 @@ fn remove_copyable(k: kind) -> kind {
|
|||||||
k - kind_(KIND_MASK_COPY | KIND_MASK_DEFAULT_MODE)
|
k - kind_(KIND_MASK_COPY | KIND_MASK_DEFAULT_MODE)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl kind: ops::BitAnd<kind,kind> {
|
|
||||||
pure fn bitand(other: kind) -> kind {
|
|
||||||
unsafe {
|
|
||||||
lower_kind(self, other)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl kind : ops::BitAnd<kind,kind> {
|
impl kind : ops::BitAnd<kind,kind> {
|
||||||
pure fn bitand(other: &kind) -> kind {
|
pure fn bitand(other: &kind) -> kind {
|
||||||
unsafe {
|
unsafe {
|
||||||
@ -1912,16 +1824,6 @@ impl kind : ops::BitAnd<kind,kind> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl kind: ops::BitOr<kind,kind> {
|
|
||||||
pure fn bitor(other: kind) -> kind {
|
|
||||||
unsafe {
|
|
||||||
raise_kind(self, other)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl kind : ops::BitOr<kind,kind> {
|
impl kind : ops::BitOr<kind,kind> {
|
||||||
pure fn bitor(other: &kind) -> kind {
|
pure fn bitor(other: &kind) -> kind {
|
||||||
unsafe {
|
unsafe {
|
||||||
@ -1930,16 +1832,6 @@ impl kind : ops::BitOr<kind,kind> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl kind: ops::Sub<kind,kind> {
|
|
||||||
pure fn sub(other: kind) -> kind {
|
|
||||||
unsafe {
|
|
||||||
kind_(*self & !*other)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl kind : ops::Sub<kind,kind> {
|
impl kind : ops::Sub<kind,kind> {
|
||||||
pure fn sub(other: &kind) -> kind {
|
pure fn sub(other: &kind) -> kind {
|
||||||
unsafe {
|
unsafe {
|
||||||
@ -4040,15 +3932,6 @@ pure fn determine_inherited_purity(parent_purity: ast::purity,
|
|||||||
} else { child_purity }
|
} else { child_purity }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl mt : cmp::Eq {
|
|
||||||
pure fn eq(&&other: mt) -> bool {
|
|
||||||
self.ty == other.ty && self.mutbl == other.mutbl
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: mt) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl mt : cmp::Eq {
|
impl mt : cmp::Eq {
|
||||||
pure fn eq(other: &mt) -> bool {
|
pure fn eq(other: &mt) -> bool {
|
||||||
self.ty == (*other).ty && self.mutbl == (*other).mutbl
|
self.ty == (*other).ty && self.mutbl == (*other).mutbl
|
||||||
@ -4056,15 +3939,6 @@ impl mt : cmp::Eq {
|
|||||||
pure fn ne(other: &mt) -> bool { !self.eq(other) }
|
pure fn ne(other: &mt) -> bool { !self.eq(other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl arg : cmp::Eq {
|
|
||||||
pure fn eq(&&other: arg) -> bool {
|
|
||||||
self.mode == other.mode && self.ty == other.ty
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: arg) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl arg : cmp::Eq {
|
impl arg : cmp::Eq {
|
||||||
pure fn eq(other: &arg) -> bool {
|
pure fn eq(other: &arg) -> bool {
|
||||||
self.mode == (*other).mode && self.ty == (*other).ty
|
self.mode == (*other).mode && self.ty == (*other).ty
|
||||||
@ -4072,15 +3946,6 @@ impl arg : cmp::Eq {
|
|||||||
pure fn ne(other: &arg) -> bool { !self.eq(other) }
|
pure fn ne(other: &arg) -> bool { !self.eq(other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl field : cmp::Eq {
|
|
||||||
pure fn eq(&&other: field) -> bool {
|
|
||||||
self.ident == other.ident && self.mt == other.mt
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: field) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl field : cmp::Eq {
|
impl field : cmp::Eq {
|
||||||
pure fn eq(other: &field) -> bool {
|
pure fn eq(other: &field) -> bool {
|
||||||
self.ident == (*other).ident && self.mt == (*other).mt
|
self.ident == (*other).ident && self.mt == (*other).mt
|
||||||
@ -4088,40 +3953,6 @@ impl field : cmp::Eq {
|
|||||||
pure fn ne(other: &field) -> bool { !self.eq(other) }
|
pure fn ne(other: &field) -> bool { !self.eq(other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl vstore : cmp::Eq {
|
|
||||||
pure fn eq(&&other: vstore) -> bool {
|
|
||||||
match self {
|
|
||||||
vstore_fixed(e0a) => {
|
|
||||||
match other {
|
|
||||||
vstore_fixed(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
vstore_uniq => {
|
|
||||||
match other {
|
|
||||||
vstore_uniq => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
vstore_box => {
|
|
||||||
match other {
|
|
||||||
vstore_box => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
vstore_slice(e0a) => {
|
|
||||||
match other {
|
|
||||||
vstore_slice(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: vstore) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl vstore : cmp::Eq {
|
impl vstore : cmp::Eq {
|
||||||
pure fn eq(other: &vstore) -> bool {
|
pure fn eq(other: &vstore) -> bool {
|
||||||
match self {
|
match self {
|
||||||
@ -4154,18 +3985,6 @@ impl vstore : cmp::Eq {
|
|||||||
pure fn ne(other: &vstore) -> bool { !self.eq(other) }
|
pure fn ne(other: &vstore) -> bool { !self.eq(other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl FnMeta : cmp::Eq {
|
|
||||||
pure fn eq(&&other: FnMeta) -> bool {
|
|
||||||
self.purity == other.purity &&
|
|
||||||
self.proto == other.proto &&
|
|
||||||
self.bounds == other.bounds &&
|
|
||||||
self.ret_style == other.ret_style
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: FnMeta) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl FnMeta : cmp::Eq {
|
impl FnMeta : cmp::Eq {
|
||||||
pure fn eq(other: &FnMeta) -> bool {
|
pure fn eq(other: &FnMeta) -> bool {
|
||||||
self.purity == (*other).purity &&
|
self.purity == (*other).purity &&
|
||||||
@ -4176,16 +3995,6 @@ impl FnMeta : cmp::Eq {
|
|||||||
pure fn ne(other: &FnMeta) -> bool { !self.eq(other) }
|
pure fn ne(other: &FnMeta) -> bool { !self.eq(other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl FnSig : cmp::Eq {
|
|
||||||
pure fn eq(&&other: FnSig) -> bool {
|
|
||||||
self.inputs == other.inputs &&
|
|
||||||
self.output == other.output
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: FnSig) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl FnSig : cmp::Eq {
|
impl FnSig : cmp::Eq {
|
||||||
pure fn eq(other: &FnSig) -> bool {
|
pure fn eq(other: &FnSig) -> bool {
|
||||||
self.inputs == (*other).inputs &&
|
self.inputs == (*other).inputs &&
|
||||||
@ -4194,15 +4003,6 @@ impl FnSig : cmp::Eq {
|
|||||||
pure fn ne(other: &FnSig) -> bool { !self.eq(other) }
|
pure fn ne(other: &FnSig) -> bool { !self.eq(other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl<M: cmp::Eq> FnTyBase<M> : cmp::Eq {
|
|
||||||
pure fn eq(&&other: FnTyBase<M>) -> bool {
|
|
||||||
self.meta == other.meta && self.sig == other.sig
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: FnTyBase<M>) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl<M: cmp::Eq> FnTyBase<M> : cmp::Eq {
|
impl<M: cmp::Eq> FnTyBase<M> : cmp::Eq {
|
||||||
pure fn eq(other: &FnTyBase<M>) -> bool {
|
pure fn eq(other: &FnTyBase<M>) -> bool {
|
||||||
self.meta == (*other).meta && self.sig == (*other).sig
|
self.meta == (*other).meta && self.sig == (*other).sig
|
||||||
@ -4210,94 +4010,26 @@ impl<M: cmp::Eq> FnTyBase<M> : cmp::Eq {
|
|||||||
pure fn ne(other: &FnTyBase<M>) -> bool { !self.eq(other) }
|
pure fn ne(other: &FnTyBase<M>) -> bool { !self.eq(other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl TyVid: cmp::Eq {
|
|
||||||
pure fn eq(&&other: TyVid) -> bool { *self == *other }
|
|
||||||
pure fn ne(&&other: TyVid) -> bool { *self != *other }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl TyVid : cmp::Eq {
|
impl TyVid : cmp::Eq {
|
||||||
pure fn eq(other: &TyVid) -> bool { *self == *(*other) }
|
pure fn eq(other: &TyVid) -> bool { *self == *(*other) }
|
||||||
pure fn ne(other: &TyVid) -> bool { *self != *(*other) }
|
pure fn ne(other: &TyVid) -> bool { *self != *(*other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl IntVid: cmp::Eq {
|
|
||||||
pure fn eq(&&other: IntVid) -> bool { *self == *other }
|
|
||||||
pure fn ne(&&other: IntVid) -> bool { *self != *other }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl IntVid : cmp::Eq {
|
impl IntVid : cmp::Eq {
|
||||||
pure fn eq(other: &IntVid) -> bool { *self == *(*other) }
|
pure fn eq(other: &IntVid) -> bool { *self == *(*other) }
|
||||||
pure fn ne(other: &IntVid) -> bool { *self != *(*other) }
|
pure fn ne(other: &IntVid) -> bool { *self != *(*other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl FnVid: cmp::Eq {
|
|
||||||
pure fn eq(&&other: FnVid) -> bool { *self == *other }
|
|
||||||
pure fn ne(&&other: FnVid) -> bool { *self != *other }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl FnVid : cmp::Eq {
|
impl FnVid : cmp::Eq {
|
||||||
pure fn eq(other: &FnVid) -> bool { *self == *(*other) }
|
pure fn eq(other: &FnVid) -> bool { *self == *(*other) }
|
||||||
pure fn ne(other: &FnVid) -> bool { *self != *(*other) }
|
pure fn ne(other: &FnVid) -> bool { *self != *(*other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl RegionVid: cmp::Eq {
|
|
||||||
pure fn eq(&&other: RegionVid) -> bool { *self == *other }
|
|
||||||
pure fn ne(&&other: RegionVid) -> bool { *self != *other }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl RegionVid : cmp::Eq {
|
impl RegionVid : cmp::Eq {
|
||||||
pure fn eq(other: &RegionVid) -> bool { *self == *(*other) }
|
pure fn eq(other: &RegionVid) -> bool { *self == *(*other) }
|
||||||
pure fn ne(other: &RegionVid) -> bool { *self != *(*other) }
|
pure fn ne(other: &RegionVid) -> bool { *self != *(*other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl region : cmp::Eq {
|
|
||||||
pure fn eq(&&other: region) -> bool {
|
|
||||||
match self {
|
|
||||||
re_bound(e0a) => {
|
|
||||||
match other {
|
|
||||||
re_bound(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
re_free(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
re_free(e0b, e1b) => e0a == e0b && e1a == e1b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
re_scope(e0a) => {
|
|
||||||
match other {
|
|
||||||
re_scope(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
re_static => {
|
|
||||||
match other {
|
|
||||||
re_static => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
re_var(e0a) => {
|
|
||||||
match other {
|
|
||||||
re_var(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: region) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl region : cmp::Eq {
|
impl region : cmp::Eq {
|
||||||
pure fn eq(other: ®ion) -> bool {
|
pure fn eq(other: ®ion) -> bool {
|
||||||
match self {
|
match self {
|
||||||
@ -4336,40 +4068,6 @@ impl region : cmp::Eq {
|
|||||||
pure fn ne(other: ®ion) -> bool { !self.eq(other) }
|
pure fn ne(other: ®ion) -> bool { !self.eq(other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl bound_region : cmp::Eq {
|
|
||||||
pure fn eq(&&other: bound_region) -> bool {
|
|
||||||
match self {
|
|
||||||
br_self => {
|
|
||||||
match other {
|
|
||||||
br_self => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
br_anon(e0a) => {
|
|
||||||
match other {
|
|
||||||
br_anon(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
br_named(e0a) => {
|
|
||||||
match other {
|
|
||||||
br_named(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
br_cap_avoid(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
br_cap_avoid(e0b, e1b) => e0a == e0b && e1a == e1b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: bound_region) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl bound_region : cmp::Eq {
|
impl bound_region : cmp::Eq {
|
||||||
pure fn eq(other: &bound_region) -> bool {
|
pure fn eq(other: &bound_region) -> bool {
|
||||||
match self {
|
match self {
|
||||||
@ -4402,17 +4100,6 @@ impl bound_region : cmp::Eq {
|
|||||||
pure fn ne(other: &bound_region) -> bool { !self.eq(other) }
|
pure fn ne(other: &bound_region) -> bool { !self.eq(other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl substs : cmp::Eq {
|
|
||||||
pure fn eq(&&other: substs) -> bool {
|
|
||||||
self.self_r == other.self_r &&
|
|
||||||
self.self_ty == other.self_ty &&
|
|
||||||
self.tps == other.tps
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: substs) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl substs : cmp::Eq {
|
impl substs : cmp::Eq {
|
||||||
pure fn eq(other: &substs) -> bool {
|
pure fn eq(other: &substs) -> bool {
|
||||||
self.self_r == (*other).self_r &&
|
self.self_r == (*other).self_r &&
|
||||||
@ -4422,15 +4109,6 @@ impl substs : cmp::Eq {
|
|||||||
pure fn ne(other: &substs) -> bool { !self.eq(other) }
|
pure fn ne(other: &substs) -> bool { !self.eq(other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl InferTy : cmp::Eq {
|
|
||||||
pure fn eq(&&other: InferTy) -> bool {
|
|
||||||
self.to_hash() == other.to_hash()
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: InferTy) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl InferTy : cmp::Eq {
|
impl InferTy : cmp::Eq {
|
||||||
pure fn eq(other: &InferTy) -> bool {
|
pure fn eq(other: &InferTy) -> bool {
|
||||||
self.to_hash() == (*other).to_hash()
|
self.to_hash() == (*other).to_hash()
|
||||||
@ -4438,167 +4116,6 @@ impl InferTy : cmp::Eq {
|
|||||||
pure fn ne(other: &InferTy) -> bool { !self.eq(other) }
|
pure fn ne(other: &InferTy) -> bool { !self.eq(other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl sty : cmp::Eq {
|
|
||||||
pure fn eq(&&other: sty) -> bool {
|
|
||||||
match self {
|
|
||||||
ty_nil => {
|
|
||||||
match other {
|
|
||||||
ty_nil => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_bot => {
|
|
||||||
match other {
|
|
||||||
ty_bot => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_bool => {
|
|
||||||
match other {
|
|
||||||
ty_bool => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_int(e0a) => {
|
|
||||||
match other {
|
|
||||||
ty_int(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_uint(e0a) => {
|
|
||||||
match other {
|
|
||||||
ty_uint(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_float(e0a) => {
|
|
||||||
match other {
|
|
||||||
ty_float(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_estr(e0a) => {
|
|
||||||
match other {
|
|
||||||
ty_estr(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_enum(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
ty_enum(e0b, e1b) => e0a == e0b && e1a == e1b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_box(e0a) => {
|
|
||||||
match other {
|
|
||||||
ty_box(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_uniq(e0a) => {
|
|
||||||
match other {
|
|
||||||
ty_uniq(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_evec(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
ty_evec(e0b, e1b) => e0a == e0b && e1a == e1b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_ptr(e0a) => {
|
|
||||||
match other {
|
|
||||||
ty_ptr(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_rptr(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
ty_rptr(e0b, e1b) => e0a == e0b && e1a == e1b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_rec(e0a) => {
|
|
||||||
match other {
|
|
||||||
ty_rec(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_fn(e0a) => {
|
|
||||||
match other {
|
|
||||||
ty_fn(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_trait(e0a, e1a, e2a) => {
|
|
||||||
match other {
|
|
||||||
ty_trait(e0b, e1b, e2b) =>
|
|
||||||
e0a == e0b && e1a == e1b && e2a == e2b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_class(e0a, e1a) => {
|
|
||||||
match other {
|
|
||||||
ty_class(e0b, e1b) => e0a == e0b && e1a == e1b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_tup(e0a) => {
|
|
||||||
match other {
|
|
||||||
ty_tup(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_infer(e0a) => {
|
|
||||||
match other {
|
|
||||||
ty_infer(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_param(e0a) => {
|
|
||||||
match other {
|
|
||||||
ty_param(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_self => {
|
|
||||||
match other {
|
|
||||||
ty_self => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_type => {
|
|
||||||
match other {
|
|
||||||
ty_type => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_opaque_box => {
|
|
||||||
match other {
|
|
||||||
ty_opaque_box => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_opaque_closure_ptr(e0a) => {
|
|
||||||
match other {
|
|
||||||
ty_opaque_closure_ptr(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ty_unboxed_vec(e0a) => {
|
|
||||||
match other {
|
|
||||||
ty_unboxed_vec(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: sty) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl sty : cmp::Eq {
|
impl sty : cmp::Eq {
|
||||||
pure fn eq(other: &sty) -> bool {
|
pure fn eq(other: &sty) -> bool {
|
||||||
match self {
|
match self {
|
||||||
@ -4758,46 +4275,6 @@ impl sty : cmp::Eq {
|
|||||||
pure fn ne(other: &sty) -> bool { !self.eq(other) }
|
pure fn ne(other: &sty) -> bool { !self.eq(other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl param_bound : cmp::Eq {
|
|
||||||
pure fn eq(&&other: param_bound) -> bool {
|
|
||||||
match self {
|
|
||||||
bound_copy => {
|
|
||||||
match other {
|
|
||||||
bound_copy => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
bound_owned => {
|
|
||||||
match other {
|
|
||||||
bound_owned => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
bound_send => {
|
|
||||||
match other {
|
|
||||||
bound_send => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
bound_const => {
|
|
||||||
match other {
|
|
||||||
bound_const => true,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
bound_trait(e0a) => {
|
|
||||||
match other {
|
|
||||||
bound_trait(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: param_bound) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl param_bound : cmp::Eq {
|
impl param_bound : cmp::Eq {
|
||||||
pure fn eq(other: ¶m_bound) -> bool {
|
pure fn eq(other: ¶m_bound) -> bool {
|
||||||
match self {
|
match self {
|
||||||
@ -4836,13 +4313,6 @@ impl param_bound : cmp::Eq {
|
|||||||
pure fn ne(other: ¶m_bound) -> bool { !self.eq(other) }
|
pure fn ne(other: ¶m_bound) -> bool { !self.eq(other) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl kind : cmp::Eq {
|
|
||||||
pure fn eq(&&other: kind) -> bool { *self == *other }
|
|
||||||
pure fn ne(&&other: kind) -> bool { *self != *other }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl kind : cmp::Eq {
|
impl kind : cmp::Eq {
|
||||||
pure fn eq(other: &kind) -> bool { *self == *(*other) }
|
pure fn eq(other: &kind) -> bool { *self == *(*other) }
|
||||||
pure fn ne(other: &kind) -> bool { *self != *(*other) }
|
pure fn ne(other: &kind) -> bool { *self != *(*other) }
|
||||||
|
@ -329,28 +329,6 @@ enum Constraint {
|
|||||||
ConstrainVarSubReg(RegionVid, region)
|
ConstrainVarSubReg(RegionVid, region)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl Constraint: cmp::Eq {
|
|
||||||
pure fn eq(&&other: Constraint) -> bool {
|
|
||||||
match (self, other) {
|
|
||||||
(ConstrainVarSubVar(v0a, v1a), ConstrainVarSubVar(v0b, v1b)) => {
|
|
||||||
v0a == v0b && v1a == v1b
|
|
||||||
}
|
|
||||||
(ConstrainRegSubVar(ra, va), ConstrainRegSubVar(rb, vb)) => {
|
|
||||||
ra == rb && va == vb
|
|
||||||
}
|
|
||||||
(ConstrainVarSubReg(va, ra), ConstrainVarSubReg(vb, rb)) => {
|
|
||||||
va == vb && ra == rb
|
|
||||||
}
|
|
||||||
(ConstrainVarSubVar(*), _) => false,
|
|
||||||
(ConstrainRegSubVar(*), _) => false,
|
|
||||||
(ConstrainVarSubReg(*), _) => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: Constraint) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl Constraint : cmp::Eq {
|
impl Constraint : cmp::Eq {
|
||||||
pure fn eq(other: &Constraint) -> bool {
|
pure fn eq(other: &Constraint) -> bool {
|
||||||
match (self, (*other)) {
|
match (self, (*other)) {
|
||||||
@ -391,15 +369,6 @@ struct TwoRegions {
|
|||||||
b: region,
|
b: region,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl TwoRegions: cmp::Eq {
|
|
||||||
pure fn eq(&&other: TwoRegions) -> bool {
|
|
||||||
self.a == other.a && self.b == other.b
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: TwoRegions) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl TwoRegions : cmp::Eq {
|
impl TwoRegions : cmp::Eq {
|
||||||
pure fn eq(other: &TwoRegions) -> bool {
|
pure fn eq(other: &TwoRegions) -> bool {
|
||||||
self.a == (*other).a && self.b == (*other).b
|
self.a == (*other).a && self.b == (*other).b
|
||||||
@ -786,15 +755,6 @@ priv impl RegionVarBindings {
|
|||||||
|
|
||||||
enum Direction { Incoming = 0, Outgoing = 1 }
|
enum Direction { Incoming = 0, Outgoing = 1 }
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl Direction : cmp::Eq {
|
|
||||||
pure fn eq(&&other: Direction) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: Direction) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl Direction : cmp::Eq {
|
impl Direction : cmp::Eq {
|
||||||
pure fn eq(other: &Direction) -> bool {
|
pure fn eq(other: &Direction) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
@ -804,15 +764,6 @@ impl Direction : cmp::Eq {
|
|||||||
|
|
||||||
enum Classification { Expanding, Contracting }
|
enum Classification { Expanding, Contracting }
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl Classification : cmp::Eq {
|
|
||||||
pure fn eq(&&other: Classification) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: Classification) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl Classification : cmp::Eq {
|
impl Classification : cmp::Eq {
|
||||||
pure fn eq(other: &Classification) -> bool {
|
pure fn eq(other: &Classification) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
|
@ -18,15 +18,6 @@ enum OutputFormat {
|
|||||||
PandocHtml
|
PandocHtml
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl OutputFormat : cmp::Eq {
|
|
||||||
pure fn eq(&&other: OutputFormat) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: OutputFormat) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl OutputFormat : cmp::Eq {
|
impl OutputFormat : cmp::Eq {
|
||||||
pure fn eq(other: &OutputFormat) -> bool {
|
pure fn eq(other: &OutputFormat) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
@ -42,15 +33,6 @@ enum OutputStyle {
|
|||||||
DocPerMod
|
DocPerMod
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl OutputStyle : cmp::Eq {
|
|
||||||
pure fn eq(&&other: OutputStyle) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: OutputStyle) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl OutputStyle : cmp::Eq {
|
impl OutputStyle : cmp::Eq {
|
||||||
pure fn eq(other: &OutputStyle) -> bool {
|
pure fn eq(other: &OutputStyle) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
|
@ -6,15 +6,6 @@ type Doc_ = {
|
|||||||
pages: ~[Page]
|
pages: ~[Page]
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl Doc_ : cmp::Eq {
|
|
||||||
pure fn eq(&&other: Doc_) -> bool {
|
|
||||||
self.pages == other.pages
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: Doc_) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl Doc_ : cmp::Eq {
|
impl Doc_ : cmp::Eq {
|
||||||
pure fn eq(other: &Doc_) -> bool {
|
pure fn eq(other: &Doc_) -> bool {
|
||||||
self.pages == (*other).pages
|
self.pages == (*other).pages
|
||||||
@ -26,13 +17,6 @@ enum Doc {
|
|||||||
Doc_(Doc_)
|
Doc_(Doc_)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl Doc : cmp::Eq {
|
|
||||||
pure fn eq(&&other: Doc) -> bool { *self == *other }
|
|
||||||
pure fn ne(&&other: Doc) -> bool { *self != *other }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl Doc : cmp::Eq {
|
impl Doc : cmp::Eq {
|
||||||
pure fn eq(other: &Doc) -> bool { *self == *(*other) }
|
pure fn eq(other: &Doc) -> bool { *self == *(*other) }
|
||||||
pure fn ne(other: &Doc) -> bool { *self != *(*other) }
|
pure fn ne(other: &Doc) -> bool { *self != *(*other) }
|
||||||
@ -43,28 +27,6 @@ enum Page {
|
|||||||
ItemPage(ItemTag)
|
ItemPage(ItemTag)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl Page : cmp::Eq {
|
|
||||||
pure fn eq(&&other: Page) -> bool {
|
|
||||||
match self {
|
|
||||||
CratePage(e0a) => {
|
|
||||||
match other {
|
|
||||||
CratePage(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ItemPage(e0a) => {
|
|
||||||
match other {
|
|
||||||
ItemPage(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: Page) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl Page : cmp::Eq {
|
impl Page : cmp::Eq {
|
||||||
pure fn eq(other: &Page) -> bool {
|
pure fn eq(other: &Page) -> bool {
|
||||||
match self {
|
match self {
|
||||||
@ -90,15 +52,6 @@ enum Implementation {
|
|||||||
Provided,
|
Provided,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl Implementation : cmp::Eq {
|
|
||||||
pure fn eq(&&other: Implementation) -> bool {
|
|
||||||
(self as uint) == (other as uint)
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: Implementation) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl Implementation : cmp::Eq {
|
impl Implementation : cmp::Eq {
|
||||||
pure fn eq(other: &Implementation) -> bool {
|
pure fn eq(other: &Implementation) -> bool {
|
||||||
(self as uint) == ((*other) as uint)
|
(self as uint) == ((*other) as uint)
|
||||||
@ -116,15 +69,6 @@ type Section = {
|
|||||||
body: ~str
|
body: ~str
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl Section : cmp::Eq {
|
|
||||||
pure fn eq(&&other: Section) -> bool {
|
|
||||||
self.header == other.header && self.body == other.body
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: Section) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl Section : cmp::Eq {
|
impl Section : cmp::Eq {
|
||||||
pure fn eq(other: &Section) -> bool {
|
pure fn eq(other: &Section) -> bool {
|
||||||
self.header == (*other).header && self.body == (*other).body
|
self.header == (*other).header && self.body == (*other).body
|
||||||
@ -139,15 +83,6 @@ type CrateDoc = {
|
|||||||
topmod: ModDoc,
|
topmod: ModDoc,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl CrateDoc : cmp::Eq {
|
|
||||||
pure fn eq(&&other: CrateDoc) -> bool {
|
|
||||||
self.topmod == other.topmod
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: CrateDoc) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl CrateDoc : cmp::Eq {
|
impl CrateDoc : cmp::Eq {
|
||||||
pure fn eq(other: &CrateDoc) -> bool {
|
pure fn eq(other: &CrateDoc) -> bool {
|
||||||
self.topmod == (*other).topmod
|
self.topmod == (*other).topmod
|
||||||
@ -167,70 +102,6 @@ enum ItemTag {
|
|||||||
StructTag(StructDoc)
|
StructTag(StructDoc)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl ItemTag : cmp::Eq {
|
|
||||||
pure fn eq(&&other: ItemTag) -> bool {
|
|
||||||
match self {
|
|
||||||
ModTag(e0a) => {
|
|
||||||
match other {
|
|
||||||
ModTag(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
NmodTag(e0a) => {
|
|
||||||
match other {
|
|
||||||
NmodTag(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ConstTag(e0a) => {
|
|
||||||
match other {
|
|
||||||
ConstTag(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FnTag(e0a) => {
|
|
||||||
match other {
|
|
||||||
FnTag(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
EnumTag(e0a) => {
|
|
||||||
match other {
|
|
||||||
EnumTag(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TraitTag(e0a) => {
|
|
||||||
match other {
|
|
||||||
TraitTag(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ImplTag(e0a) => {
|
|
||||||
match other {
|
|
||||||
ImplTag(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TyTag(e0a) => {
|
|
||||||
match other {
|
|
||||||
TyTag(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
StructTag(e0a) => {
|
|
||||||
match other {
|
|
||||||
StructTag(e0b) => e0a == e0b,
|
|
||||||
_ => false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: ItemTag) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl ItemTag : cmp::Eq {
|
impl ItemTag : cmp::Eq {
|
||||||
pure fn eq(other: &ItemTag) -> bool {
|
pure fn eq(other: &ItemTag) -> bool {
|
||||||
match self {
|
match self {
|
||||||
@ -304,21 +175,6 @@ type ItemDoc = {
|
|||||||
reexport: bool
|
reexport: bool
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl ItemDoc : cmp::Eq {
|
|
||||||
pure fn eq(&&other: ItemDoc) -> bool {
|
|
||||||
self.id == other.id &&
|
|
||||||
self.name == other.name &&
|
|
||||||
self.path == other.path &&
|
|
||||||
self.brief == other.brief &&
|
|
||||||
self.desc == other.desc &&
|
|
||||||
self.sections == other.sections &&
|
|
||||||
self.reexport == other.reexport
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: ItemDoc) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl ItemDoc : cmp::Eq {
|
impl ItemDoc : cmp::Eq {
|
||||||
pure fn eq(other: &ItemDoc) -> bool {
|
pure fn eq(other: &ItemDoc) -> bool {
|
||||||
self.id == (*other).id &&
|
self.id == (*other).id &&
|
||||||
@ -337,15 +193,6 @@ type SimpleItemDoc = {
|
|||||||
sig: Option<~str>
|
sig: Option<~str>
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl SimpleItemDoc : cmp::Eq {
|
|
||||||
pure fn eq(&&other: SimpleItemDoc) -> bool {
|
|
||||||
self.item == other.item && self.sig == other.sig
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: SimpleItemDoc) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl SimpleItemDoc : cmp::Eq {
|
impl SimpleItemDoc : cmp::Eq {
|
||||||
pure fn eq(other: &SimpleItemDoc) -> bool {
|
pure fn eq(other: &SimpleItemDoc) -> bool {
|
||||||
self.item == (*other).item && self.sig == (*other).sig
|
self.item == (*other).item && self.sig == (*other).sig
|
||||||
@ -359,17 +206,6 @@ type ModDoc_ = {
|
|||||||
index: Option<Index>
|
index: Option<Index>
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl ModDoc_ : cmp::Eq {
|
|
||||||
pure fn eq(&&other: ModDoc_) -> bool {
|
|
||||||
self.item == other.item &&
|
|
||||||
self.items == other.items &&
|
|
||||||
self.index == other.index
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: ModDoc_) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl ModDoc_ : cmp::Eq {
|
impl ModDoc_ : cmp::Eq {
|
||||||
pure fn eq(other: &ModDoc_) -> bool {
|
pure fn eq(other: &ModDoc_) -> bool {
|
||||||
self.item == (*other).item &&
|
self.item == (*other).item &&
|
||||||
@ -383,13 +219,6 @@ enum ModDoc {
|
|||||||
ModDoc_(ModDoc_)
|
ModDoc_(ModDoc_)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl ModDoc : cmp::Eq {
|
|
||||||
pure fn eq(&&other: ModDoc) -> bool { *self == *other }
|
|
||||||
pure fn ne(&&other: ModDoc) -> bool { *self != *other }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl ModDoc : cmp::Eq {
|
impl ModDoc : cmp::Eq {
|
||||||
pure fn eq(other: &ModDoc) -> bool { *self == *(*other) }
|
pure fn eq(other: &ModDoc) -> bool { *self == *(*other) }
|
||||||
pure fn ne(other: &ModDoc) -> bool { *self != *(*other) }
|
pure fn ne(other: &ModDoc) -> bool { *self != *(*other) }
|
||||||
@ -401,17 +230,6 @@ type NmodDoc = {
|
|||||||
index: Option<Index>
|
index: Option<Index>
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl NmodDoc : cmp::Eq {
|
|
||||||
pure fn eq(&&other: NmodDoc) -> bool {
|
|
||||||
self.item == other.item &&
|
|
||||||
self.fns == other.fns &&
|
|
||||||
self.index == other.index
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: NmodDoc) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl NmodDoc : cmp::Eq {
|
impl NmodDoc : cmp::Eq {
|
||||||
pure fn eq(other: &NmodDoc) -> bool {
|
pure fn eq(other: &NmodDoc) -> bool {
|
||||||
self.item == (*other).item &&
|
self.item == (*other).item &&
|
||||||
@ -430,15 +248,6 @@ type EnumDoc = {
|
|||||||
variants: ~[VariantDoc]
|
variants: ~[VariantDoc]
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl EnumDoc : cmp::Eq {
|
|
||||||
pure fn eq(&&other: EnumDoc) -> bool {
|
|
||||||
self.item == other.item && self.variants == other.variants
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: EnumDoc) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl EnumDoc : cmp::Eq {
|
impl EnumDoc : cmp::Eq {
|
||||||
pure fn eq(other: &EnumDoc) -> bool {
|
pure fn eq(other: &EnumDoc) -> bool {
|
||||||
self.item == (*other).item && self.variants == (*other).variants
|
self.item == (*other).item && self.variants == (*other).variants
|
||||||
@ -452,17 +261,6 @@ type VariantDoc = {
|
|||||||
sig: Option<~str>
|
sig: Option<~str>
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl VariantDoc : cmp::Eq {
|
|
||||||
pure fn eq(&&other: VariantDoc) -> bool {
|
|
||||||
self.name == other.name &&
|
|
||||||
self.desc == other.desc &&
|
|
||||||
self.sig == other.sig
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: VariantDoc) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl VariantDoc : cmp::Eq {
|
impl VariantDoc : cmp::Eq {
|
||||||
pure fn eq(other: &VariantDoc) -> bool {
|
pure fn eq(other: &VariantDoc) -> bool {
|
||||||
self.name == (*other).name &&
|
self.name == (*other).name &&
|
||||||
@ -477,15 +275,6 @@ type TraitDoc = {
|
|||||||
methods: ~[MethodDoc]
|
methods: ~[MethodDoc]
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl TraitDoc : cmp::Eq {
|
|
||||||
pure fn eq(&&other: TraitDoc) -> bool {
|
|
||||||
self.item == other.item && self.methods == other.methods
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: TraitDoc) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl TraitDoc : cmp::Eq {
|
impl TraitDoc : cmp::Eq {
|
||||||
pure fn eq(other: &TraitDoc) -> bool {
|
pure fn eq(other: &TraitDoc) -> bool {
|
||||||
self.item == (*other).item && self.methods == (*other).methods
|
self.item == (*other).item && self.methods == (*other).methods
|
||||||
@ -502,20 +291,6 @@ type MethodDoc = {
|
|||||||
implementation: Implementation,
|
implementation: Implementation,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl MethodDoc : cmp::Eq {
|
|
||||||
pure fn eq(&&other: MethodDoc) -> bool {
|
|
||||||
self.name == other.name &&
|
|
||||||
self.brief == other.brief &&
|
|
||||||
self.desc == other.desc &&
|
|
||||||
self.sections == other.sections &&
|
|
||||||
self.sig == other.sig &&
|
|
||||||
self.implementation == other.implementation
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: MethodDoc) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl MethodDoc : cmp::Eq {
|
impl MethodDoc : cmp::Eq {
|
||||||
pure fn eq(other: &MethodDoc) -> bool {
|
pure fn eq(other: &MethodDoc) -> bool {
|
||||||
self.name == (*other).name &&
|
self.name == (*other).name &&
|
||||||
@ -535,18 +310,6 @@ type ImplDoc = {
|
|||||||
methods: ~[MethodDoc]
|
methods: ~[MethodDoc]
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl ImplDoc : cmp::Eq {
|
|
||||||
pure fn eq(&&other: ImplDoc) -> bool {
|
|
||||||
self.item == other.item &&
|
|
||||||
self.trait_types == other.trait_types &&
|
|
||||||
self.self_ty == other.self_ty &&
|
|
||||||
self.methods == other.methods
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: ImplDoc) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl ImplDoc : cmp::Eq {
|
impl ImplDoc : cmp::Eq {
|
||||||
pure fn eq(other: &ImplDoc) -> bool {
|
pure fn eq(other: &ImplDoc) -> bool {
|
||||||
self.item == (*other).item &&
|
self.item == (*other).item &&
|
||||||
@ -578,15 +341,6 @@ type Index = {
|
|||||||
entries: ~[IndexEntry]
|
entries: ~[IndexEntry]
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl Index : cmp::Eq {
|
|
||||||
pure fn eq(&&other: Index) -> bool {
|
|
||||||
self.entries == other.entries
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: Index) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl Index : cmp::Eq {
|
impl Index : cmp::Eq {
|
||||||
pure fn eq(other: &Index) -> bool {
|
pure fn eq(other: &Index) -> bool {
|
||||||
self.entries == (*other).entries
|
self.entries == (*other).entries
|
||||||
@ -611,18 +365,6 @@ type IndexEntry = {
|
|||||||
link: ~str
|
link: ~str
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl IndexEntry : cmp::Eq {
|
|
||||||
pure fn eq(&&other: IndexEntry) -> bool {
|
|
||||||
self.kind == other.kind &&
|
|
||||||
self.name == other.name &&
|
|
||||||
self.brief == other.brief &&
|
|
||||||
self.link == other.link
|
|
||||||
}
|
|
||||||
pure fn ne(&&other: IndexEntry) -> bool { !self.eq(other) }
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl IndexEntry : cmp::Eq {
|
impl IndexEntry : cmp::Eq {
|
||||||
pure fn eq(other: &IndexEntry) -> bool {
|
pure fn eq(other: &IndexEntry) -> bool {
|
||||||
self.kind == (*other).kind &&
|
self.kind == (*other).kind &&
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
S 2012-09-23 92752a4
|
||||||
|
macos-i386 0d5130364e8610413c9da965ca5ce6967f32ab3d
|
||||||
|
macos-x86_64 a0bc17c9025c509b0ecfb35d04e35b8b232f2687
|
||||||
|
freebsd-x86_64 6568c5ab6199e0e24fb442511ccb2ebad8eb4785
|
||||||
|
linux-i386 685318ae8cd618eff60b51015ebe51b34383072b
|
||||||
|
linux-x86_64 d8893f7c2be05bf18fbda26e65a151446251a3bd
|
||||||
|
winnt-i386 23f8a9d0d788cdcc0a69a3276adb457cf4aa474f
|
||||||
|
|
||||||
S 2012-09-12 fa74edf
|
S 2012-09-12 fa74edf
|
||||||
macos-i386 da38aa39fd1515ea765790a3c320194bc50fd602
|
macos-i386 da38aa39fd1515ea765790a3c320194bc50fd602
|
||||||
macos-x86_64 7509861e5a6d3e082ad9a9d3474661856b7731c1
|
macos-x86_64 7509861e5a6d3e082ad9a9d3474661856b7731c1
|
||||||
|
@ -2,14 +2,6 @@
|
|||||||
|
|
||||||
enum foo = ~uint;
|
enum foo = ~uint;
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl foo: Add<foo, foo> {
|
|
||||||
pure fn add(f: foo) -> foo {
|
|
||||||
foo(~(**self + **f))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl foo : Add<foo, foo> {
|
impl foo : Add<foo, foo> {
|
||||||
pure fn add(f: &foo) -> foo {
|
pure fn add(f: &foo) -> foo {
|
||||||
foo(~(**self + **(*f)))
|
foo(~(**self + **(*f)))
|
||||||
|
@ -8,14 +8,6 @@ struct Point {
|
|||||||
y: int,
|
y: int,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl Point : ops::Add<int,int> {
|
|
||||||
pure fn add(&&z: int) -> int {
|
|
||||||
self.x + self.y + z
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl Point : ops::Add<int,int> {
|
impl Point : ops::Add<int,int> {
|
||||||
pure fn add(z: &int) -> int {
|
pure fn add(z: &int) -> int {
|
||||||
self.x + self.y + (*z)
|
self.x + self.y + (*z)
|
||||||
|
@ -16,14 +16,6 @@ struct S {
|
|||||||
|
|
||||||
fn S(x: int) -> S { S { x: x } }
|
fn S(x: int) -> S { S { x: x } }
|
||||||
|
|
||||||
#[cfg(stage0)]
|
|
||||||
impl S: Add<S, S> {
|
|
||||||
pure fn add(rhs: S) -> S {
|
|
||||||
S { x: self.x + rhs.x }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#[cfg(stage1)]
|
|
||||||
#[cfg(stage2)]
|
|
||||||
impl S : Add<S, S> {
|
impl S : Add<S, S> {
|
||||||
pure fn add(rhs: &S) -> S {
|
pure fn add(rhs: &S) -> S {
|
||||||
S { x: self.x + (*rhs).x }
|
S { x: self.x + (*rhs).x }
|
||||||
|
Loading…
Reference in New Issue
Block a user