aboutsummaryrefslogtreecommitdiff
path: root/src/raw/sse2.rs
diff options
context:
space:
mode:
authorJoel Galenson <jgalenson@google.com>2021-04-05 15:48:43 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-04-05 15:48:43 +0000
commit8c1f11ab5b9ef805cdbf02558db809ab40890974 (patch)
treea6caf250f8bc9d3ac3958804fdf9a08e1ea5504b /src/raw/sse2.rs
parent73b9b9a6c7b79b607d51ce8de67d87722b649d23 (diff)
parent486b32152e6c9035ed032b4ba6d1f1dddcd06478 (diff)
downloadhashbrown-8c1f11ab5b9ef805cdbf02558db809ab40890974.tar.gz
Upgrade rust/crates/hashbrown to 0.11.2 am: 486b32152e
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/hashbrown/+/1662704 Change-Id: Ic503aaea4a50e4da55ee36b738354881141f5e4f
Diffstat (limited to 'src/raw/sse2.rs')
-rw-r--r--src/raw/sse2.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/raw/sse2.rs b/src/raw/sse2.rs
index a27bc09..eed9684 100644
--- a/src/raw/sse2.rs
+++ b/src/raw/sse2.rs
@@ -28,12 +28,13 @@ impl Group {
/// value for an empty hash table.
///
/// This is guaranteed to be aligned to the group size.
+ #[allow(clippy::items_after_statements)]
pub const fn static_empty() -> &'static [u8; Group::WIDTH] {
#[repr(C)]
struct AlignedBytes {
_align: [Group; 0],
bytes: [u8; Group::WIDTH],
- };
+ }
const ALIGNED_BYTES: AlignedBytes = AlignedBytes {
_align: [],
bytes: [EMPTY; Group::WIDTH],
@@ -45,7 +46,7 @@ impl Group {
#[inline]
#[allow(clippy::cast_ptr_alignment)] // unaligned load
pub unsafe fn load(ptr: *const u8) -> Self {
- Group(x86::_mm_loadu_si128(ptr as *const _))
+ Group(x86::_mm_loadu_si128(ptr.cast()))
}
/// Loads a group of bytes starting at the given address, which must be
@@ -55,7 +56,7 @@ impl Group {
pub unsafe fn load_aligned(ptr: *const u8) -> Self {
// FIXME: use align_offset once it stabilizes
debug_assert_eq!(ptr as usize & (mem::align_of::<Self>() - 1), 0);
- Group(x86::_mm_load_si128(ptr as *const _))
+ Group(x86::_mm_load_si128(ptr.cast()))
}
/// Stores the group of bytes to the given address, which must be
@@ -65,7 +66,7 @@ impl Group {
pub unsafe fn store_aligned(self, ptr: *mut u8) {
// FIXME: use align_offset once it stabilizes
debug_assert_eq!(ptr as usize & (mem::align_of::<Self>() - 1), 0);
- x86::_mm_store_si128(ptr as *mut _, self.0);
+ x86::_mm_store_si128(ptr.cast(), self.0);
}
/// Returns a `BitMask` indicating all bytes in the group which have