Skip to content

Commit 8d9bcda

Browse files
committed
Fix or silence lints
1 parent 6b1e7f6 commit 8d9bcda

File tree

6 files changed

+12
-4
lines changed

6 files changed

+12
-4
lines changed

crates/core_simd/examples/nbody.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![feature(portable_simd)]
2+
#![allow(clippy::excessive_precision)]
23
extern crate std_float;
34

45
/// Benchmarks game nbody code

crates/core_simd/src/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ pub mod simd {
3434
pub use crate::core_simd::lane_count::{LaneCount, SupportedLaneCount};
3535
pub use crate::core_simd::masks::*;
3636
pub use crate::core_simd::swizzle::*;
37-
pub use crate::core_simd::swizzle_dyn::*;
3837
pub use crate::core_simd::to_bytes::ToBytes;
3938
pub use crate::core_simd::vector::*;
4039
}

crates/core_simd/src/to_bytes.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ macro_rules! impl_to_bytes {
6868
#[inline]
6969
fn to_ne_bytes(self) -> Self::Bytes {
7070
// Safety: transmuting between vectors is safe
71-
unsafe { core::mem::transmute(self) }
71+
unsafe {
72+
#![allow(clippy::useless_transmute)]
73+
core::mem::transmute(self)
74+
}
7275
}
7376

7477
#[inline]
@@ -90,7 +93,10 @@ macro_rules! impl_to_bytes {
9093
#[inline]
9194
fn from_ne_bytes(bytes: Self::Bytes) -> Self {
9295
// Safety: transmuting between vectors is safe
93-
unsafe { core::mem::transmute(bytes) }
96+
unsafe {
97+
#![allow(clippy::useless_transmute)]
98+
core::mem::transmute(bytes)
99+
}
94100
}
95101

96102
#[inline]

crates/core_simd/src/vector.rs

+1
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ where
127127
/// assert_eq!(v.len(), 4);
128128
/// ```
129129
#[inline]
130+
#[allow(clippy::len_without_is_empty)]
130131
pub const fn len(&self) -> usize {
131132
Self::LEN
132133
}

crates/core_simd/tests/ops_macros.rs

+2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ macro_rules! impl_binary_checked_op_test {
6868

6969
test_helpers::test_lanes! {
7070
fn normal<const LANES: usize>() {
71+
#![allow(clippy::redundant_closure_call)]
7172
test_helpers::test_binary_elementwise(
7273
&<Simd<$scalar, LANES> as core::ops::$trait>::$fn,
7374
&$scalar_fn,
@@ -76,6 +77,7 @@ macro_rules! impl_binary_checked_op_test {
7677
}
7778

7879
fn assign<const LANES: usize>() {
80+
#![allow(clippy::redundant_closure_call)]
7981
test_helpers::test_binary_elementwise(
8082
&|mut a, b| { <Simd<$scalar, LANES> as core::ops::$trait_assign>::$fn_assign(&mut a, b); a },
8183
&$scalar_fn,

crates/core_simd/tests/swizzle_dyn.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![feature(portable_simd)]
22
use core::{fmt, ops::RangeInclusive};
3-
use proptest;
43
use test_helpers::{self, biteq, make_runner, prop_assert_biteq};
54

65
fn swizzle_dyn_scalar_ver<const N: usize>(values: [u8; N], idxs: [u8; N]) -> [u8; N] {

0 commit comments

Comments
 (0)