Skip to content

Commit 4e11ae3

Browse files
author
Cole Miller
committed
Apply suggestions from Clippy's ptr_as_ptr lint
1 parent def8aba commit 4e11ae3

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/raw/generic.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl Group {
6767
#[inline]
6868
#[allow(clippy::cast_ptr_alignment)] // unaligned load
6969
pub unsafe fn load(ptr: *const u8) -> Self {
70-
Group(ptr::read_unaligned(ptr as *const _))
70+
Group(ptr::read_unaligned(ptr.cast()))
7171
}
7272

7373
/// Loads a group of bytes starting at the given address, which must be
@@ -77,7 +77,7 @@ impl Group {
7777
pub unsafe fn load_aligned(ptr: *const u8) -> Self {
7878
// FIXME: use align_offset once it stabilizes
7979
debug_assert_eq!(ptr as usize & (mem::align_of::<Self>() - 1), 0);
80-
Group(ptr::read(ptr as *const _))
80+
Group(ptr::read(ptr.cast()))
8181
}
8282

8383
/// Stores the group of bytes to the given address, which must be
@@ -87,7 +87,7 @@ impl Group {
8787
pub unsafe fn store_aligned(self, ptr: *mut u8) {
8888
// FIXME: use align_offset once it stabilizes
8989
debug_assert_eq!(ptr as usize & (mem::align_of::<Self>() - 1), 0);
90-
ptr::write(ptr as *mut _, self.0);
90+
ptr::write(ptr.cast(), self.0);
9191
}
9292

9393
/// Returns a `BitMask` indicating all bytes in the group which *may*

src/raw/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ impl<T, A: Allocator + Clone> RawTable<T, A> {
530530
/// Returns pointer to one past last element of data table.
531531
#[cfg_attr(feature = "inline-more", inline)]
532532
pub unsafe fn data_end(&self) -> NonNull<T> {
533-
NonNull::new_unchecked(self.ctrl.as_ptr() as *mut T)
533+
NonNull::new_unchecked(self.ctrl.as_ptr().cast())
534534
}
535535

536536
/// Returns pointer to start of data table.

src/raw/sse2.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl Group {
4646
#[inline]
4747
#[allow(clippy::cast_ptr_alignment)] // unaligned load
4848
pub unsafe fn load(ptr: *const u8) -> Self {
49-
Group(x86::_mm_loadu_si128(ptr as *const _))
49+
Group(x86::_mm_loadu_si128(ptr.cast()))
5050
}
5151

5252
/// Loads a group of bytes starting at the given address, which must be
@@ -56,7 +56,7 @@ impl Group {
5656
pub unsafe fn load_aligned(ptr: *const u8) -> Self {
5757
// FIXME: use align_offset once it stabilizes
5858
debug_assert_eq!(ptr as usize & (mem::align_of::<Self>() - 1), 0);
59-
Group(x86::_mm_load_si128(ptr as *const _))
59+
Group(x86::_mm_load_si128(ptr.cast()))
6060
}
6161

6262
/// Stores the group of bytes to the given address, which must be
@@ -66,7 +66,7 @@ impl Group {
6666
pub unsafe fn store_aligned(self, ptr: *mut u8) {
6767
// FIXME: use align_offset once it stabilizes
6868
debug_assert_eq!(ptr as usize & (mem::align_of::<Self>() - 1), 0);
69-
x86::_mm_store_si128(ptr as *mut _, self.0);
69+
x86::_mm_store_si128(ptr.cast(), self.0);
7070
}
7171

7272
/// Returns a `BitMask` indicating all bytes in the group which have

0 commit comments

Comments
 (0)