]> git.lizzy.rs Git - rust.git/blobdiff - src/libcore/ptr.rs
Merge pull request #20674 from jbcrail/fix-misspelled-comments
[rust.git] / src / libcore / ptr.rs
index f29d75181492b0b31df14ddd5af4d45a197779f6..20305c3191a098f24f73e1503f7e3a68595b4208 100644 (file)
 use mem;
 use clone::Clone;
 use intrinsics;
-use option::Option::{mod, Some, None};
-use kinds::{Send, Sized, Sync};
+use option::Option::{self, Some, None};
+use marker::{Send, Sized, Sync};
 
-use cmp::{PartialEq, Eq, Ord, PartialOrd, Equiv};
-use cmp::Ordering::{mod, Less, Equal, Greater};
+use cmp::{PartialEq, Eq, Ord, PartialOrd};
+use cmp::Ordering::{self, Less, Equal, Greater};
 
-// FIXME #19649: instrinsic docs don't render, so these have no docs :(
+// FIXME #19649: intrinsic docs don't render, so these have no docs :(
 
 #[unstable]
 pub use intrinsics::copy_nonoverlapping_memory;
@@ -233,7 +233,7 @@ pub unsafe fn read_and_zero<T>(dest: *mut T) -> T {
 /// not drop the contents of `dst`. This could leak allocations or resources,
 /// so care must be taken not to overwrite an object that should be dropped.
 ///
-/// This is appropriate for initializing uninitialized memory, or overwritting
+/// This is appropriate for initializing uninitialized memory, or overwriting
 /// memory that has previously been `read` from.
 #[inline]
 #[stable]
@@ -246,22 +246,10 @@ pub unsafe fn write<T>(dst: *mut T, src: T) {
 pub trait PtrExt: Sized {
     type Target;
 
-    /// Returns the null pointer.
-    #[deprecated = "call ptr::null instead"]
-    fn null() -> Self;
-
     /// Returns true if the pointer is null.
     #[stable]
     fn is_null(self) -> bool;
 
-    /// Returns true if the pointer is not equal to the null pointer.
-    #[deprecated = "use !p.is_null() instead"]
-    fn is_not_null(self) -> bool { !self.is_null() }
-
-    /// Returns true if the pointer is not null.
-    #[deprecated = "use `as uint` instead"]
-    fn to_uint(self) -> uint;
-
     /// Returns `None` if the pointer is null, or else returns a reference to
     /// the value wrapped in `Some`.
     ///
@@ -308,18 +296,10 @@ pub trait MutPtrExt {
 impl<T> PtrExt for *const T {
     type Target = T;
 
-    #[inline]
-    #[deprecated = "call ptr::null instead"]
-    fn null() -> *const T { null() }
-
     #[inline]
     #[stable]
     fn is_null(self) -> bool { self as uint == 0 }
 
-    #[inline]
-    #[deprecated = "use `as uint` instead"]
-    fn to_uint(self) -> uint { self as uint }
-
     #[inline]
     #[stable]
     unsafe fn offset(self, count: int) -> *const T {
@@ -342,18 +322,10 @@ unsafe fn as_ref<'a>(&self) -> Option<&'a T> {
 impl<T> PtrExt for *mut T {
     type Target = T;
 
-    #[inline]
-    #[deprecated = "call ptr::null instead"]
-    fn null() -> *mut T { null_mut() }
-
     #[inline]
     #[stable]
     fn is_null(self) -> bool { self as uint == 0 }
 
-    #[inline]
-    #[deprecated = "use `as uint` instead"]
-    fn to_uint(self) -> uint { self as uint }
-
     #[inline]
     #[stable]
     unsafe fn offset(self, count: int) -> *mut T {
@@ -415,23 +387,6 @@ fn ne(&self, other: &*mut T) -> bool { !self.eq(other) }
 #[stable]
 impl<T> Eq for *mut T {}
 
-// Equivalence for pointers
-#[allow(deprecated)]
-#[deprecated = "Use overloaded `core::cmp::PartialEq`"]
-impl<T> Equiv<*mut T> for *const T {
-    fn equiv(&self, other: &*mut T) -> bool {
-        self.to_uint() == other.to_uint()
-    }
-}
-
-#[allow(deprecated)]
-#[deprecated = "Use overloaded `core::cmp::PartialEq`"]
-impl<T> Equiv<*const T> for *mut T {
-    fn equiv(&self, other: &*const T) -> bool {
-        self.to_uint() == other.to_uint()
-    }
-}
-
 #[stable]
 impl<T> Clone for *const T {
     #[inline]