From 2f8ae3d7e023bfdf3ce87a2caf9fbdbdeb157916 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Sun, 30 Jul 2023 15:03:03 +0700 Subject: [PATCH] clippy: Some simple clippy fixes. --- crates/core_arch/src/aarch64/tme.rs | 4 ++-- crates/core_arch/src/wasm32/relaxed_simd.rs | 2 +- crates/core_arch/src/wasm32/simd128.rs | 26 +++++++-------------- crates/core_arch/src/x86/avx.rs | 2 +- 4 files changed, 12 insertions(+), 22 deletions(-) diff --git a/crates/core_arch/src/aarch64/tme.rs b/crates/core_arch/src/aarch64/tme.rs index 05df313e4c..15f1b877d6 100644 --- a/crates/core_arch/src/aarch64/tme.rs +++ b/crates/core_arch/src/aarch64/tme.rs @@ -21,9 +21,9 @@ extern "unadjusted" { #[link_name = "llvm.aarch64.tstart"] fn aarch64_tstart() -> u64; #[link_name = "llvm.aarch64.tcommit"] - fn aarch64_tcommit() -> (); + fn aarch64_tcommit(); #[link_name = "llvm.aarch64.tcancel"] - fn aarch64_tcancel(imm0: u64) -> (); + fn aarch64_tcancel(imm0: u64); #[link_name = "llvm.aarch64.ttest"] fn aarch64_ttest() -> u64; } diff --git a/crates/core_arch/src/wasm32/relaxed_simd.rs b/crates/core_arch/src/wasm32/relaxed_simd.rs index 9ee8c8e559..403fc79d01 100644 --- a/crates/core_arch/src/wasm32/relaxed_simd.rs +++ b/crates/core_arch/src/wasm32/relaxed_simd.rs @@ -307,7 +307,7 @@ mod tests { use super::super::simd128::*; use super::*; use core::ops::{Add, Div, Mul, Neg, Sub}; - use std; + use std::fmt::Debug; use std::mem::transmute; use std::num::Wrapping; diff --git a/crates/core_arch/src/wasm32/simd128.rs b/crates/core_arch/src/wasm32/simd128.rs index ff544d0865..4819195dc6 100644 --- a/crates/core_arch/src/wasm32/simd128.rs +++ b/crates/core_arch/src/wasm32/simd128.rs @@ -3202,7 +3202,7 @@ pub fn i32x4_shr(a: v128, amt: u32) -> v128 { #[doc(alias("i32x4.shr_u"))] #[stable(feature = "wasm_simd", since = "1.54.0")] pub fn u32x4_shr(a: v128, amt: u32) -> v128 { - unsafe { simd_shr(a.as_u32x4(), simd::u32x4::splat(amt as u32)).v128() } + unsafe { simd_shr(a.as_u32x4(), simd::u32x4::splat(amt)).v128() } } /// Adds two 128-bit vectors as if they were two packed four 32-bit integers. @@ -4229,7 +4229,7 @@ pub fn f64x2_promote_low_f32x4(a: v128) -> v128 { mod tests { use super::*; use core::ops::{Add, Div, Mul, Neg, Sub}; - use std; + use std::fmt::Debug; use std::mem::transmute; use std::num::Wrapping; @@ -4577,8 +4577,8 @@ mod tests { u8::MAX.into(), ), i16x8( - i16::MIN.into(), - i16::MAX.into(), + i16::MIN, + i16::MAX, u16::MIN as i16, u16::MAX as i16, 0, @@ -4603,8 +4603,8 @@ mod tests { u8::MAX.into(), ), i16x8( - i16::MIN.into(), - i16::MAX.into(), + i16::MIN, + i16::MAX, u16::MIN as i16, u16::MAX as i16, 0, @@ -4624,12 +4624,7 @@ mod tests { compare_bytes( i16x8_narrow_i32x4( i32x4(0, -1, i16::MIN.into(), i16::MAX.into()), - i32x4( - i32::MIN.into(), - i32::MAX.into(), - u32::MIN as i32, - u32::MAX as i32, - ), + i32x4(i32::MIN, i32::MAX, u32::MIN as i32, u32::MAX as i32), ), i16x8(0, -1, i16::MIN, i16::MAX, i16::MIN, i16::MAX, 0, -1), ); @@ -4637,12 +4632,7 @@ mod tests { compare_bytes( u16x8_narrow_i32x4( i32x4(u16::MAX.into(), -1, i16::MIN.into(), i16::MAX.into()), - i32x4( - i32::MIN.into(), - i32::MAX.into(), - u32::MIN as i32, - u32::MAX as i32, - ), + i32x4(i32::MIN, i32::MAX, u32::MIN as i32, u32::MAX as i32), ), i16x8(-1, 0, 0, i16::MAX, 0, -1, 0, 0), ); diff --git a/crates/core_arch/src/x86/avx.rs b/crates/core_arch/src/x86/avx.rs index 097a17f997..c4f76cf092 100644 --- a/crates/core_arch/src/x86/avx.rs +++ b/crates/core_arch/src/x86/avx.rs @@ -1519,7 +1519,7 @@ pub unsafe fn _mm256_loadu_si256(mem_addr: *const __m256i) -> __m256i { } /// Stores 256-bits of integer data from `a` into memory. -/// `mem_addr` does not need to be aligned on any particular boundary. +/// `mem_addr` does not need to be aligned on any particular boundary. /// /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_storeu_si256) #[inline]