From 8179e268efd86ae5c1bcf21b4f8d4e01eea7c193 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Wed, 28 Nov 2012 12:33:00 -0800 Subject: Register snapshots --- src/libcore/ptr.rs | 68 ------------------------------------------------------ 1 file changed, 68 deletions(-) (limited to 'src/libcore/ptr.rs') diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index 7cba022e7c3..d1566735a3f 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -208,75 +208,31 @@ impl *mut T: Ptr { // Equality for pointers impl *const T : Eq { - #[cfg(stage0)] - 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; - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: &*const T) -> bool unsafe { let a: uint = cast::reinterpret_cast(&(*self)); let b: uint = cast::reinterpret_cast(&(*other)); return a == b; } - #[cfg(stage0)] - pure fn ne(other: &*const T) -> bool { !self.eq(other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: &*const T) -> bool { !(*self).eq(other) } } // Comparison for pointers impl *const T : Ord { - #[cfg(stage0)] - 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; - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn lt(&self, other: &*const T) -> bool unsafe { let a: uint = cast::reinterpret_cast(&(*self)); let b: uint = cast::reinterpret_cast(&(*other)); return a < b; } - #[cfg(stage0)] - 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; - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn le(&self, other: &*const T) -> bool unsafe { let a: uint = cast::reinterpret_cast(&(*self)); let b: uint = cast::reinterpret_cast(&(*other)); return a <= b; } - #[cfg(stage0)] - 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; - } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ge(&self, other: &*const T) -> bool unsafe { let a: uint = cast::reinterpret_cast(&(*self)); let b: uint = cast::reinterpret_cast(&(*other)); return a >= b; } - #[cfg(stage0)] - 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)] pure fn gt(&self, other: &*const T) -> bool unsafe { let a: uint = cast::reinterpret_cast(&(*self)); let b: uint = cast::reinterpret_cast(&(*other)); @@ -286,17 +242,9 @@ impl *const T : Ord { // Equality for region pointers impl &const T : Eq { - #[cfg(stage0)] - pure fn eq(other: & &self/const T) -> bool { return *self == *(*other); } - #[cfg(stage1)] - #[cfg(stage2)] pure fn eq(&self, other: & &self/const T) -> bool { return *(*self) == *(*other); } - #[cfg(stage0)] - pure fn ne(other: & &self/const T) -> bool { return *self != *(*other); } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ne(&self, other: & &self/const T) -> bool { return *(*self) != *(*other); } @@ -304,31 +252,15 @@ impl &const T : Eq { // Comparison for region pointers impl &const T : Ord { - #[cfg(stage0)] - pure fn lt(other: & &self/const T) -> bool { *self < *(*other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn lt(&self, other: & &self/const T) -> bool { *(*self) < *(*other) } - #[cfg(stage0)] - pure fn le(other: & &self/const T) -> bool { *self <= *(*other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn le(&self, other: & &self/const T) -> bool { *(*self) <= *(*other) } - #[cfg(stage0)] - pure fn ge(other: & &self/const T) -> bool { *self >= *(*other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn ge(&self, other: & &self/const T) -> bool { *(*self) >= *(*other) } - #[cfg(stage0)] - pure fn gt(other: & &self/const T) -> bool { *self > *(*other) } - #[cfg(stage1)] - #[cfg(stage2)] pure fn gt(&self, other: & &self/const T) -> bool { *(*self) > *(*other) } -- cgit 1.4.1-3-g733a5