Skip to content

Commit de6d3fc

Browse files
authored
Fix some clippy lints (#937)
1 parent 818fd4a commit de6d3fc

File tree

22 files changed

+80
-88
lines changed

22 files changed

+80
-88
lines changed

crates/assert-instr-macro/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn main() {
66
.ok()
77
.and_then(|s| s.parse().ok())
88
.unwrap_or(0);
9-
let profile = env::var("PROFILE").unwrap_or(String::new());
9+
let profile = env::var("PROFILE").unwrap_or_default();
1010
if profile == "release" || opt_level >= 2 {
1111
println!("cargo:rustc-cfg=optimized");
1212
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ impl syn::parse::Parse for Invoc {
179179
continue;
180180
}
181181
if input.parse::<Token![.]>().is_ok() {
182-
instr.push_str(".");
182+
instr.push('.');
183183
continue;
184184
}
185185
if let Ok(s) = input.parse::<syn::LitStr>() {

crates/core_arch/src/x86/avx2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4052,7 +4052,7 @@ extern "C" {
40524052

40534053
#[cfg(test)]
40544054
mod tests {
4055-
use std;
4055+
40564056
use stdarch_test::simd_test;
40574057

40584058
use crate::core_arch::x86::*;

crates/core_arch/src/x86/avx512f.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22727,7 +22727,7 @@ extern "C" {
2272722727

2272822728
#[cfg(test)]
2272922729
mod tests {
22730-
use std;
22730+
2273122731
use stdarch_test::simd_test;
2273222732

2273322733
use crate::core_arch::x86::*;

crates/core_arch/src/x86/avx512ifma.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ extern "C" {
105105

106106
#[cfg(test)]
107107
mod tests {
108-
use std;
108+
109109
use stdarch_test::simd_test;
110110

111111
use crate::core_arch::x86::*;

crates/core_arch/src/x86/fma.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ extern "C" {
500500

501501
#[cfg(test)]
502502
mod tests {
503-
use std;
503+
504504
use stdarch_test::simd_test;
505505

506506
use crate::core_arch::x86::*;

crates/core_arch/src/x86/fxsr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ use stdarch_test::assert_instr;
66
#[allow(improper_ctypes)]
77
extern "C" {
88
#[link_name = "llvm.x86.fxsave"]
9-
fn fxsave(p: *mut u8) -> ();
9+
fn fxsave(p: *mut u8);
1010
#[link_name = "llvm.x86.fxrstor"]
11-
fn fxrstor(p: *const u8) -> ();
11+
fn fxrstor(p: *const u8);
1212
}
1313

1414
/// Saves the `x87` FPU, `MMX` technology, `XMM`, and `MXCSR` registers to the

crates/core_arch/src/x86/rtm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ extern "C" {
2020
#[link_name = "llvm.x86.xbegin"]
2121
fn x86_xbegin() -> i32;
2222
#[link_name = "llvm.x86.xend"]
23-
fn x86_xend() -> ();
23+
fn x86_xend();
2424
#[link_name = "llvm.x86.xabort"]
25-
fn x86_xabort(imm8: i8) -> ();
25+
fn x86_xabort(imm8: i8);
2626
#[link_name = "llvm.x86.xtest"]
2727
fn x86_xtest() -> i32;
2828
}

crates/core_arch/src/x86/sse.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3106,8 +3106,8 @@ mod tests {
31063106
let mut p = vals.as_mut_ptr();
31073107

31083108
if (p as usize) & 0xf != 0 {
3109-
ofs = (16 - (p as usize) & 0xf) >> 2;
3110-
p = p.offset(ofs as isize);
3109+
ofs = ((16 - (p as usize)) & 0xf) >> 2;
3110+
p = p.add(ofs);
31113111
}
31123112

31133113
_mm_store1_ps(p, *black_box(&a));
@@ -3132,8 +3132,8 @@ mod tests {
31323132

31333133
// Align p to 16-byte boundary
31343134
if (p as usize) & 0xf != 0 {
3135-
ofs = (16 - (p as usize) & 0xf) >> 2;
3136-
p = p.offset(ofs as isize);
3135+
ofs = ((16 - (p as usize)) & 0xf) >> 2;
3136+
p = p.add(ofs);
31373137
}
31383138

31393139
_mm_store_ps(p, *black_box(&a));
@@ -3158,8 +3158,8 @@ mod tests {
31583158

31593159
// Align p to 16-byte boundary
31603160
if (p as usize) & 0xf != 0 {
3161-
ofs = (16 - (p as usize) & 0xf) >> 2;
3162-
p = p.offset(ofs as isize);
3161+
ofs = ((16 - (p as usize)) & 0xf) >> 2;
3162+
p = p.add(ofs);
31633163
}
31643164

31653165
_mm_storer_ps(p, *black_box(&a));

crates/core_arch/src/x86/xsave.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ use stdarch_test::assert_instr;
77
#[allow(improper_ctypes)]
88
extern "C" {
99
#[link_name = "llvm.x86.xsave"]
10-
fn xsave(p: *mut u8, hi: u32, lo: u32) -> ();
10+
fn xsave(p: *mut u8, hi: u32, lo: u32);
1111
#[link_name = "llvm.x86.xrstor"]
12-
fn xrstor(p: *const u8, hi: u32, lo: u32) -> ();
12+
fn xrstor(p: *const u8, hi: u32, lo: u32);
1313
#[link_name = "llvm.x86.xsetbv"]
14-
fn xsetbv(v: u32, hi: u32, lo: u32) -> ();
14+
fn xsetbv(v: u32, hi: u32, lo: u32);
1515
#[link_name = "llvm.x86.xsaveopt"]
16-
fn xsaveopt(p: *mut u8, hi: u32, lo: u32) -> ();
16+
fn xsaveopt(p: *mut u8, hi: u32, lo: u32);
1717
#[link_name = "llvm.x86.xsavec"]
18-
fn xsavec(p: *mut u8, hi: u32, lo: u32) -> ();
18+
fn xsavec(p: *mut u8, hi: u32, lo: u32);
1919
#[link_name = "llvm.x86.xsaves"]
20-
fn xsaves(p: *mut u8, hi: u32, lo: u32) -> ();
20+
fn xsaves(p: *mut u8, hi: u32, lo: u32);
2121
#[link_name = "llvm.x86.xrstors"]
22-
fn xrstors(p: *const u8, hi: u32, lo: u32) -> ();
22+
fn xrstors(p: *const u8, hi: u32, lo: u32);
2323
}
2424

2525
/// Performs a full or partial save of the enabled processor states to memory at

0 commit comments

Comments
 (0)