about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorwe <vadim.petrochenkov@gmail.com>2015-01-17 07:34:10 +0300
committerwe <vadim.petrochenkov@gmail.com>2015-01-17 07:34:10 +0300
commit812ce6c190d896cf1cc1bef9f22c00266e962c43 (patch)
treea70faf13b6c86821d8cdfe12d4eebc6985201859 /src/libcore
parent378fb5846d2d8dbc5ab24a5e92794c5c39d492dc (diff)
Remove unnecessary explicit conversions to *const T
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/atomic.rs12
-rw-r--r--src/libcore/ptr.rs2
-rw-r--r--src/libcore/slice.rs4
3 files changed, 9 insertions, 9 deletions
diff --git a/src/libcore/atomic.rs b/src/libcore/atomic.rs
index aa93d9ed837..18f7fff9053 100644
--- a/src/libcore/atomic.rs
+++ b/src/libcore/atomic.rs
@@ -199,7 +199,7 @@ impl AtomicBool {
     #[inline]
     #[stable]
     pub fn load(&self, order: Ordering) -> bool {
-        unsafe { atomic_load(self.v.get() as *const usize, order) > 0 }
+        unsafe { atomic_load(self.v.get(), order) > 0 }
     }
 
     /// Stores a value into the bool.
@@ -438,7 +438,7 @@ impl AtomicIsize {
     /// ```
     #[inline]
     pub fn load(&self, order: Ordering) -> isize {
-        unsafe { atomic_load(self.v.get() as *const isize, order) }
+        unsafe { atomic_load(self.v.get(), order) }
     }
 
     /// Stores a value into the isize.
@@ -615,7 +615,7 @@ impl AtomicUsize {
     /// ```
     #[inline]
     pub fn load(&self, order: Ordering) -> usize {
-        unsafe { atomic_load(self.v.get() as *const usize, order) }
+        unsafe { atomic_load(self.v.get(), order) }
     }
 
     /// Stores a value into the usize.
@@ -796,7 +796,7 @@ impl<T> AtomicPtr<T> {
     #[stable]
     pub fn load(&self, order: Ordering) -> *mut T {
         unsafe {
-            atomic_load(self.p.get() as *const *mut T, order) as *mut T
+            atomic_load(self.p.get(), order) as *mut T
         }
     }
 
@@ -1070,7 +1070,7 @@ impl AtomicInt {
 
     #[inline]
     pub fn load(&self, order: Ordering) -> int {
-        unsafe { atomic_load(self.v.get() as *const int, order) }
+        unsafe { atomic_load(self.v.get(), order) }
     }
 
     #[inline]
@@ -1123,7 +1123,7 @@ impl AtomicUint {
 
     #[inline]
     pub fn load(&self, order: Ordering) -> uint {
-        unsafe { atomic_load(self.v.get() as *const uint, order) }
+        unsafe { atomic_load(self.v.get(), order) }
     }
 
     #[inline]
diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs
index baf998d0828..0b89467d63b 100644
--- a/src/libcore/ptr.rs
+++ b/src/libcore/ptr.rs
@@ -329,7 +329,7 @@ impl<T> PtrExt for *mut T {
     #[inline]
     #[stable]
     unsafe fn offset(self, count: int) -> *mut T {
-        intrinsics::offset(self as *const T, count) as *mut T
+        intrinsics::offset(self, count) as *mut T
     }
 
     #[inline]
diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs
index 22da168911d..50cbb7a61dc 100644
--- a/src/libcore/slice.rs
+++ b/src/libcore/slice.rs
@@ -741,7 +741,7 @@ macro_rules! make_slice {
             diff / mem::size_of::<$t>()
         };
         unsafe {
-            transmute::<_, $result>(RawSlice { data: $start as *const T, len: len })
+            transmute::<_, $result>(RawSlice { data: $start, len: len })
         }
     }}
 }
@@ -1409,7 +1409,7 @@ pub unsafe fn from_raw_buf<'a, T>(p: &'a *const T, len: uint) -> &'a [T] {
 #[inline]
 #[unstable = "should be renamed to from_raw_parts_mut"]
 pub unsafe fn from_raw_mut_buf<'a, T>(p: &'a *mut T, len: uint) -> &'a mut [T] {
-    transmute(RawSlice { data: *p as *const T, len: len })
+    transmute(RawSlice { data: *p, len: len })
 }
 
 //