diff options
| author | Caleb Zulawski <caleb.zulawski@gmail.com> | 2023-11-17 00:48:35 -0500 |
|---|---|---|
| committer | Caleb Zulawski <caleb.zulawski@gmail.com> | 2023-11-17 00:48:35 -0500 |
| commit | 8d9bcda64cfe5f4dd172620d5d0eacadbdb13751 (patch) | |
| tree | c116e98829030035708e5dfded57898365f425b2 | |
| parent | 6b1e7f6c060b7c8a1b7781d446f96a3dd7e839f0 (diff) | |
| download | rust-8d9bcda64cfe5f4dd172620d5d0eacadbdb13751.tar.gz rust-8d9bcda64cfe5f4dd172620d5d0eacadbdb13751.zip | |
Fix or silence lints
| -rw-r--r-- | crates/core_simd/examples/nbody.rs | 1 | ||||
| -rw-r--r-- | crates/core_simd/src/mod.rs | 1 | ||||
| -rw-r--r-- | crates/core_simd/src/to_bytes.rs | 10 | ||||
| -rw-r--r-- | crates/core_simd/src/vector.rs | 1 | ||||
| -rw-r--r-- | crates/core_simd/tests/ops_macros.rs | 2 | ||||
| -rw-r--r-- | crates/core_simd/tests/swizzle_dyn.rs | 1 |
6 files changed, 12 insertions, 4 deletions
diff --git a/crates/core_simd/examples/nbody.rs b/crates/core_simd/examples/nbody.rs index 154e24c460e..65820d1340b 100644 --- a/crates/core_simd/examples/nbody.rs +++ b/crates/core_simd/examples/nbody.rs @@ -1,4 +1,5 @@ #![feature(portable_simd)] +#![allow(clippy::excessive_precision)] extern crate std_float; /// Benchmarks game nbody code diff --git a/crates/core_simd/src/mod.rs b/crates/core_simd/src/mod.rs index 6fd458d24e7..fd016f1c6f7 100644 --- a/crates/core_simd/src/mod.rs +++ b/crates/core_simd/src/mod.rs @@ -34,7 +34,6 @@ pub mod simd { pub use crate::core_simd::lane_count::{LaneCount, SupportedLaneCount}; pub use crate::core_simd::masks::*; pub use crate::core_simd::swizzle::*; - pub use crate::core_simd::swizzle_dyn::*; pub use crate::core_simd::to_bytes::ToBytes; pub use crate::core_simd::vector::*; } diff --git a/crates/core_simd/src/to_bytes.rs b/crates/core_simd/src/to_bytes.rs index dd01929551c..222526c4ab3 100644 --- a/crates/core_simd/src/to_bytes.rs +++ b/crates/core_simd/src/to_bytes.rs @@ -68,7 +68,10 @@ macro_rules! impl_to_bytes { #[inline] fn to_ne_bytes(self) -> Self::Bytes { // Safety: transmuting between vectors is safe - unsafe { core::mem::transmute(self) } + unsafe { + #![allow(clippy::useless_transmute)] + core::mem::transmute(self) + } } #[inline] @@ -90,7 +93,10 @@ macro_rules! impl_to_bytes { #[inline] fn from_ne_bytes(bytes: Self::Bytes) -> Self { // Safety: transmuting between vectors is safe - unsafe { core::mem::transmute(bytes) } + unsafe { + #![allow(clippy::useless_transmute)] + core::mem::transmute(bytes) + } } #[inline] diff --git a/crates/core_simd/src/vector.rs b/crates/core_simd/src/vector.rs index 6b7c7f1436a..105c06741c5 100644 --- a/crates/core_simd/src/vector.rs +++ b/crates/core_simd/src/vector.rs @@ -127,6 +127,7 @@ where /// assert_eq!(v.len(), 4); /// ``` #[inline] + #[allow(clippy::len_without_is_empty)] pub const fn len(&self) -> usize { Self::LEN } diff --git a/crates/core_simd/tests/ops_macros.rs b/crates/core_simd/tests/ops_macros.rs index 50faba04991..aa565a13752 100644 --- a/crates/core_simd/tests/ops_macros.rs +++ b/crates/core_simd/tests/ops_macros.rs @@ -68,6 +68,7 @@ macro_rules! impl_binary_checked_op_test { test_helpers::test_lanes! { fn normal<const LANES: usize>() { + #![allow(clippy::redundant_closure_call)] test_helpers::test_binary_elementwise( &<Simd<$scalar, LANES> as core::ops::$trait>::$fn, &$scalar_fn, @@ -76,6 +77,7 @@ macro_rules! impl_binary_checked_op_test { } fn assign<const LANES: usize>() { + #![allow(clippy::redundant_closure_call)] test_helpers::test_binary_elementwise( &|mut a, b| { <Simd<$scalar, LANES> as core::ops::$trait_assign>::$fn_assign(&mut a, b); a }, &$scalar_fn, diff --git a/crates/core_simd/tests/swizzle_dyn.rs b/crates/core_simd/tests/swizzle_dyn.rs index 646cd5f3383..f21a937f01c 100644 --- a/crates/core_simd/tests/swizzle_dyn.rs +++ b/crates/core_simd/tests/swizzle_dyn.rs @@ -1,6 +1,5 @@ #![feature(portable_simd)] use core::{fmt, ops::RangeInclusive}; -use proptest; use test_helpers::{self, biteq, make_runner, prop_assert_biteq}; fn swizzle_dyn_scalar_ver<const N: usize>(values: [u8; N], idxs: [u8; N]) -> [u8; N] { |
