diff options
| author | bors <bors@rust-lang.org> | 2013-06-02 16:55:33 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-06-02 16:55:33 -0700 |
| commit | c40baf68cb3306f1beaf1d5443bb2433043b7da7 (patch) | |
| tree | 964b03a12db214c3a63fbed78ca50ec8fb973819 /src/libstd/ptr.rs | |
| parent | dad945646fe7ec6592adfdf21b4bc464ac5c1fe7 (diff) | |
| parent | 454133127a78e14ae4922d96579f1d1a433fa54c (diff) | |
| download | rust-c40baf68cb3306f1beaf1d5443bb2433043b7da7.tar.gz rust-c40baf68cb3306f1beaf1d5443bb2433043b7da7.zip | |
auto merge of #6905 : thestinger/rust/ptr, r=catamorphism
The ptr module is intended to be for raw pointers. Closes #3111
Diffstat (limited to 'src/libstd/ptr.rs')
| -rw-r--r-- | src/libstd/ptr.rs | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/libstd/ptr.rs b/src/libstd/ptr.rs index ebc0a4b1e96..1d9a9b9be36 100644 --- a/src/libstd/ptr.rs +++ b/src/libstd/ptr.rs @@ -255,18 +255,6 @@ pub fn to_mut_unsafe_ptr<T>(thing: &mut T) -> *mut T { thing as *mut T } -/// Cast a region pointer - &T - to a uint. -#[inline(always)] -pub fn to_uint<T>(thing: &T) -> uint { - thing as *T as uint -} - -/// Determine if two borrowed pointers point to the same thing. -#[inline(always)] -pub fn ref_eq<'a,'b,T>(thing: &'a T, other: &'b T) -> bool { - to_uint(thing) == to_uint(other) -} - /** Given a **T (pointer to an array of pointers), iterate through each *T, up to the provided `len`, @@ -411,40 +399,6 @@ impl<T> Ord for *const T { } } -// Equality for region pointers -#[cfg(not(test))] -impl<'self,T:Eq> Eq for &'self T { - #[inline(always)] - fn eq(&self, other: & &'self T) -> bool { - *(*self) == *(*other) - } - #[inline(always)] - fn ne(&self, other: & &'self T) -> bool { - *(*self) != *(*other) - } -} - -// Comparison for region pointers -#[cfg(not(test))] -impl<'self,T:Ord> Ord for &'self T { - #[inline(always)] - fn lt(&self, other: & &'self T) -> bool { - *(*self) < *(*other) - } - #[inline(always)] - fn le(&self, other: & &'self T) -> bool { - *(*self) <= *(*other) - } - #[inline(always)] - fn ge(&self, other: & &'self T) -> bool { - *(*self) >= *(*other) - } - #[inline(always)] - fn gt(&self, other: & &'self T) -> bool { - *(*self) > *(*other) - } -} - #[cfg(test)] pub mod ptr_tests { use super::*; |
