Skip to content

Commit bd92b7c

Browse files
committed
Fix clippy lints
1 parent 3733375 commit bd92b7c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

crates/core_simd/src/swizzle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,8 @@ where
473473
#[inline]
474474
#[must_use = "method returns a new vector and does not mutate the original inputs"]
475475
pub fn interleave(self, other: Self) -> (Self, Self) {
476-
// Safety: swizzles are safe for masks
477476
let (lo, hi) = self.to_int().interleave(other.to_int());
477+
// Safety: swizzles are safe for masks
478478
unsafe { (Self::from_int_unchecked(lo), Self::from_int_unchecked(hi)) }
479479
}
480480

@@ -502,8 +502,8 @@ where
502502
#[inline]
503503
#[must_use = "method returns a new vector and does not mutate the original inputs"]
504504
pub fn deinterleave(self, other: Self) -> (Self, Self) {
505-
// Safety: swizzles are safe for masks
506505
let (even, odd) = self.to_int().deinterleave(other.to_int());
506+
// Safety: swizzles are safe for masks
507507
unsafe {
508508
(
509509
Self::from_int_unchecked(even),

crates/core_simd/src/vector.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,9 @@ where
442442
///
443443
/// When the element is disabled, that memory location is not accessed and the corresponding
444444
/// value from `or` is passed through.
445+
///
446+
/// # Safety
447+
/// Enabled loads must not exceed the length of `slice`.
445448
#[must_use]
446449
#[inline]
447450
pub unsafe fn load_select_unchecked(
@@ -459,6 +462,9 @@ where
459462
///
460463
/// When the element is disabled, that memory location is not accessed and the corresponding
461464
/// value from `or` is passed through.
465+
///
466+
/// # Safety
467+
/// Enabled `ptr` elements must be safe to read as if by `std::ptr::read`.
462468
#[must_use]
463469
#[inline]
464470
pub unsafe fn load_select_ptr(
@@ -1214,6 +1220,7 @@ fn lane_indices<const N: usize>() -> Simd<usize, N>
12141220
where
12151221
LaneCount<N>: SupportedLaneCount,
12161222
{
1223+
#![allow(clippy::needless_range_loop)]
12171224
let mut index = [0; N];
12181225
for i in 0..N {
12191226
index[i] = i;

0 commit comments

Comments
 (0)