Skip to content

Commit 06e1906

Browse files
committed
Fix clippy issues
1 parent adb2e89 commit 06e1906

File tree

24 files changed

+61
-86
lines changed

24 files changed

+61
-86
lines changed

crates/assert-instr-macro/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub fn assert_instr(
4747
.replace('.', "_")
4848
.replace('/', "_")
4949
.replace(':', "_")
50-
.replace(|c: char| c.is_whitespace(), "");
50+
.replace(char::is_whitespace, "");
5151
let assert_name = syn::Ident::new(&format!("assert_{}_{}", name, instr_str), name.span());
5252
let shim_name = syn::Ident::new(&format!("{}_shim_{}", name, instr_str), name.span());
5353
let mut inputs = Vec::new();

crates/core_arch/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
clippy::cast_possible_truncation,
4646
clippy::cast_precision_loss,
4747
clippy::shadow_reuse,
48-
clippy::cyclomatic_complexity,
4948
clippy::cognitive_complexity,
5049
clippy::similar_names,
5150
clippy::many_single_char_names

crates/core_arch/src/macros.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,7 @@ macro_rules! types {
275275
#[derive(Copy, Clone, Debug)]
276276
#[allow(non_camel_case_types)]
277277
#[repr(simd)]
278-
#[cfg_attr(feature = "cargo-clippy",
279-
allow(clippy::missing_inline_in_public_items))]
278+
#[allow(clippy::missing_inline_in_public_items)]
280279
pub struct $name($($fields)*);
281280
)*)
282281
}

crates/core_arch/src/simd.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ macro_rules! simd_ty {
99
#[derive(Copy, Clone, Debug, PartialEq)]
1010
pub(crate) struct $id($(pub $elem_ty),*);
1111

12-
#[cfg_attr(feature = "cargo-clippy", allow(clippy::use_self))]
12+
#[allow(clippy::use_self)]
1313
impl $id {
1414
#[inline]
1515
pub(crate) const fn new($($elem_name: $elem_ty),*) -> Self {
@@ -41,7 +41,7 @@ macro_rules! simd_m_ty {
4141
#[derive(Copy, Clone, Debug, PartialEq)]
4242
pub(crate) struct $id($(pub $elem_ty),*);
4343

44-
#[cfg_attr(feature = "cargo-clippy", allow(clippy::use_self))]
44+
#[allow(clippy::use_self)]
4545
impl $id {
4646
#[inline]
4747
const fn bool_to_internal(x: bool) -> $ety {

crates/core_arch/src/x86/adx.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ pub unsafe fn _addcarry_u32(c_in: u8, a: u32, b: u32, out: &mut u32) -> u8 {
3232
#[stable(feature = "simd_x86_adx", since = "1.33.0")]
3333
#[cfg(not(stage0))]
3434
pub unsafe fn _addcarryx_u32(c_in: u8, a: u32, b: u32, out: &mut u32) -> u8 {
35-
let r = llvm_addcarryx_u32(c_in, a, b, out as *mut _ as *mut u8);
36-
r
35+
llvm_addcarryx_u32(c_in, a, b, out as *mut _ as *mut u8)
3736
}
3837

3938
/// Adds unsigned 32-bit integers `a` and `b` with unsigned 8-bit carry-in `c_in`

crates/core_arch/src/x86/avx.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,7 @@ pub unsafe fn _mm256_permute2f128_si256(a: __m256i, b: __m256i, imm8: i32) -> __
14521452
#[target_feature(enable = "avx")]
14531453
#[cfg_attr(test, assert_instr(vbroadcastss))]
14541454
#[stable(feature = "simd_x86", since = "1.27.0")]
1455-
#[cfg_attr(feature = "cargo-clippy", allow(clippy::trivially_copy_pass_by_ref))]
1455+
#[allow(clippy::trivially_copy_pass_by_ref)]
14561456
pub unsafe fn _mm256_broadcast_ss(f: &f32) -> __m256 {
14571457
_mm256_set1_ps(*f)
14581458
}
@@ -1465,7 +1465,7 @@ pub unsafe fn _mm256_broadcast_ss(f: &f32) -> __m256 {
14651465
#[target_feature(enable = "avx")]
14661466
#[cfg_attr(test, assert_instr(vbroadcastss))]
14671467
#[stable(feature = "simd_x86", since = "1.27.0")]
1468-
#[cfg_attr(feature = "cargo-clippy", allow(clippy::trivially_copy_pass_by_ref))]
1468+
#[allow(clippy::trivially_copy_pass_by_ref)]
14691469
pub unsafe fn _mm_broadcast_ss(f: &f32) -> __m128 {
14701470
_mm_set1_ps(*f)
14711471
}
@@ -1478,7 +1478,7 @@ pub unsafe fn _mm_broadcast_ss(f: &f32) -> __m128 {
14781478
#[target_feature(enable = "avx")]
14791479
#[cfg_attr(test, assert_instr(vbroadcastsd))]
14801480
#[stable(feature = "simd_x86", since = "1.27.0")]
1481-
#[cfg_attr(feature = "cargo-clippy", allow(clippy::trivially_copy_pass_by_ref))]
1481+
#[allow(clippy::trivially_copy_pass_by_ref)]
14821482
pub unsafe fn _mm256_broadcast_sd(f: &f64) -> __m256d {
14831483
_mm256_set1_pd(*f)
14841484
}
@@ -1618,7 +1618,7 @@ pub unsafe fn _mm256_insert_epi32(a: __m256i, i: i32, index: i32) -> __m256i {
16181618
#[target_feature(enable = "avx")]
16191619
#[cfg_attr(test, assert_instr(vmovaps))] // FIXME vmovapd expected
16201620
#[stable(feature = "simd_x86", since = "1.27.0")]
1621-
#[cfg_attr(feature = "cargo-clippy", allow(clippy::cast_ptr_alignment))]
1621+
#[allow(clippy::cast_ptr_alignment)]
16221622
pub unsafe fn _mm256_load_pd(mem_addr: *const f64) -> __m256d {
16231623
*(mem_addr as *const __m256d)
16241624
}
@@ -1633,7 +1633,7 @@ pub unsafe fn _mm256_load_pd(mem_addr: *const f64) -> __m256d {
16331633
#[target_feature(enable = "avx")]
16341634
#[cfg_attr(test, assert_instr(vmovaps))] // FIXME vmovapd expected
16351635
#[stable(feature = "simd_x86", since = "1.27.0")]
1636-
#[cfg_attr(feature = "cargo-clippy", allow(clippy::cast_ptr_alignment))]
1636+
#[allow(clippy::cast_ptr_alignment)]
16371637
pub unsafe fn _mm256_store_pd(mem_addr: *const f64, a: __m256d) {
16381638
*(mem_addr as *mut __m256d) = a;
16391639
}
@@ -1648,7 +1648,7 @@ pub unsafe fn _mm256_store_pd(mem_addr: *const f64, a: __m256d) {
16481648
#[target_feature(enable = "avx")]
16491649
#[cfg_attr(test, assert_instr(vmovaps))]
16501650
#[stable(feature = "simd_x86", since = "1.27.0")]
1651-
#[cfg_attr(feature = "cargo-clippy", allow(clippy::cast_ptr_alignment))]
1651+
#[allow(clippy::cast_ptr_alignment)]
16521652
pub unsafe fn _mm256_load_ps(mem_addr: *const f32) -> __m256 {
16531653
*(mem_addr as *const __m256)
16541654
}
@@ -1663,7 +1663,7 @@ pub unsafe fn _mm256_load_ps(mem_addr: *const f32) -> __m256 {
16631663
#[target_feature(enable = "avx")]
16641664
#[cfg_attr(test, assert_instr(vmovaps))]
16651665
#[stable(feature = "simd_x86", since = "1.27.0")]
1666-
#[cfg_attr(feature = "cargo-clippy", allow(clippy::cast_ptr_alignment))]
1666+
#[allow(clippy::cast_ptr_alignment)]
16671667
pub unsafe fn _mm256_store_ps(mem_addr: *const f32, a: __m256) {
16681668
*(mem_addr as *mut __m256) = a;
16691669
}
@@ -1959,7 +1959,7 @@ pub unsafe fn _mm256_stream_si256(mem_addr: *mut __m256i, a: __m256i) {
19591959
#[target_feature(enable = "avx")]
19601960
#[cfg_attr(test, assert_instr(vmovntps))] // FIXME vmovntpd
19611961
#[stable(feature = "simd_x86", since = "1.27.0")]
1962-
#[cfg_attr(feature = "cargo-clippy", allow(clippy::cast_ptr_alignment))]
1962+
#[allow(clippy::cast_ptr_alignment)]
19631963
pub unsafe fn _mm256_stream_pd(mem_addr: *mut f64, a: __m256d) {
19641964
intrinsics::nontemporal_store(mem_addr as *mut __m256d, a);
19651965
}
@@ -1974,7 +1974,7 @@ pub unsafe fn _mm256_stream_pd(mem_addr: *mut f64, a: __m256d) {
19741974
#[target_feature(enable = "avx")]
19751975
#[cfg_attr(test, assert_instr(vmovntps))]
19761976
#[stable(feature = "simd_x86", since = "1.27.0")]
1977-
#[cfg_attr(feature = "cargo-clippy", allow(clippy::cast_ptr_alignment))]
1977+
#[allow(clippy::cast_ptr_alignment)]
19781978
pub unsafe fn _mm256_stream_ps(mem_addr: *mut f32, a: __m256) {
19791979
intrinsics::nontemporal_store(mem_addr as *mut __m256, a);
19801980
}

crates/core_arch/src/x86/bswap.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Byte swap intrinsics.
2-
3-
#![cfg_attr(feature = "cargo-clippy", allow(clippy::stutter))]
2+
#![allow(clippy::module_name_repetitions)]
43

54
#[cfg(test)]
65
use stdsimd_test::assert_instr;

crates/core_arch/src/x86/cpuid.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
//! `cpuid` intrinsics
2-
3-
#![cfg_attr(feature = "cargo-clippy", allow(clippy::module_name_repetitions))]
2+
#![allow(clippy::module_name_repetitions)]
43

54
#[cfg(test)]
65
use stdsimd_test::assert_instr;
76

87
/// Result of the `cpuid` instruction.
9-
#[cfg_attr(
10-
feature = "cargo-clippy",
11-
// the derived impl of Debug for CpuidResult is not #[inline] and that's OK.
12-
allow(clippy::missing_inline_in_public_items)
13-
)]
8+
#[allow(clippy::missing_inline_in_public_items)]
9+
// ^^ the derived impl of Debug for CpuidResult is not #[inline] and that's OK.
1410
#[derive(Copy, Clone, Debug, Eq, Ord, PartialEq, PartialOrd)]
1511
#[stable(feature = "simd_x86", since = "1.27.0")]
1612
pub struct CpuidResult {

crates/core_arch/src/x86/rdrand.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
//! RDRAND and RDSEED instructions for returning random numbers from an Intel
22
//! on-chip hardware random number generator which has been seeded by an
33
//! on-chip entropy source.
4-
5-
#![cfg_attr(feature = "cargo-clippy", allow(clippy::module_name_repetitions))]
4+
#![allow(clippy::module_name_repetitions)]
65

76
#[allow(improper_ctypes)]
87
extern "unadjusted" {

crates/core_arch/src/x86/sse.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ pub unsafe fn _mm_load_ps1(p: *const f32) -> __m128 {
12091209
#[target_feature(enable = "sse")]
12101210
#[cfg_attr(test, assert_instr(movaps))]
12111211
#[stable(feature = "simd_x86", since = "1.27.0")]
1212-
#[cfg_attr(feature = "cargo-clippy", allow(clippy::cast_ptr_alignment))]
1212+
#[allow(clippy::cast_ptr_alignment)]
12131213
pub unsafe fn _mm_load_ps(p: *const f32) -> __m128 {
12141214
*(p as *const __m128)
12151215
}
@@ -1370,7 +1370,7 @@ pub unsafe fn _mm_store_ss(p: *mut f32, a: __m128) {
13701370
#[target_feature(enable = "sse")]
13711371
#[cfg_attr(test, assert_instr(movaps))]
13721372
#[stable(feature = "simd_x86", since = "1.27.0")]
1373-
#[cfg_attr(feature = "cargo-clippy", allow(clippy::cast_ptr_alignment))]
1373+
#[allow(clippy::cast_ptr_alignment)]
13741374
pub unsafe fn _mm_store1_ps(p: *mut f32, a: __m128) {
13751375
let b: __m128 = simd_shuffle4(a, a, [0, 0, 0, 0]);
13761376
*(p as *mut __m128) = b;
@@ -1402,7 +1402,7 @@ pub unsafe fn _mm_store_ps1(p: *mut f32, a: __m128) {
14021402
#[target_feature(enable = "sse")]
14031403
#[cfg_attr(test, assert_instr(movaps))]
14041404
#[stable(feature = "simd_x86", since = "1.27.0")]
1405-
#[cfg_attr(feature = "cargo-clippy", allow(clippy::cast_ptr_alignment))]
1405+
#[allow(clippy::cast_ptr_alignment)]
14061406
pub unsafe fn _mm_store_ps(p: *mut f32, a: __m128) {
14071407
*(p as *mut __m128) = a;
14081408
}
@@ -1446,7 +1446,7 @@ pub unsafe fn _mm_storeu_ps(p: *mut f32, a: __m128) {
14461446
#[target_feature(enable = "sse")]
14471447
#[cfg_attr(test, assert_instr(movaps))]
14481448
#[stable(feature = "simd_x86", since = "1.27.0")]
1449-
#[cfg_attr(feature = "cargo-clippy", allow(clippy::cast_ptr_alignment))]
1449+
#[allow(clippy::cast_ptr_alignment)]
14501450
pub unsafe fn _mm_storer_ps(p: *mut f32, a: __m128) {
14511451
let b: __m128 = simd_shuffle4(a, a, [3, 2, 1, 0]);
14521452
*(p as *mut __m128) = b;
@@ -2033,7 +2033,7 @@ extern "C" {
20332033
#[target_feature(enable = "sse")]
20342034
#[cfg_attr(test, assert_instr(movntps))]
20352035
#[stable(feature = "simd_x86", since = "1.27.0")]
2036-
#[cfg_attr(feature = "cargo-clippy", allow(clippy::cast_ptr_alignment))]
2036+
#[allow(clippy::cast_ptr_alignment)]
20372037
pub unsafe fn _mm_stream_ps(mem_addr: *mut f32, a: __m128) {
20382038
intrinsics::nontemporal_store(mem_addr as *mut __m128, a);
20392039
}

0 commit comments

Comments
 (0)