Skip to content

Commit

Permalink
Remove useless drop (clippy drop_ref and drop_copy lint)
Browse files Browse the repository at this point in the history
  • Loading branch information
Urgau authored and Amanieu committed Apr 21, 2023
1 parent d100d41 commit 5f5ddf8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crates/core_arch/src/wasm32/simd128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4719,7 +4719,7 @@ pub mod tests {
let v2_v128: v128 = mem::transmute(v2);
let v3_v128 = super::$f(v1_v128, v2_v128);
let mut v3 = [$($vec1)*];
drop(v3);
let _ignore = v3;
v3 = mem::transmute(v3_v128);

for (i, actual) in v3.iter().enumerate() {
Expand All @@ -4746,7 +4746,7 @@ pub mod tests {
let v1_v128: v128 = mem::transmute(v1);
let v2_v128 = super::$f(v1_v128);
let mut v2 = [$($vec1)*];
drop(v2);
let _ignore = v2;
v2 = mem::transmute(v2_v128);

for (i, actual) in v2.iter().enumerate() {
Expand Down
7 changes: 5 additions & 2 deletions crates/std_detect/src/detect/os/linux/auxvec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ pub(crate) fn auxv() -> Result<AuxVec, ()> {
}
}
}
drop(hwcap);

// Intentionnaly not used
let _ = hwcap;
}
}

Expand Down Expand Up @@ -251,7 +253,8 @@ fn auxv_from_buf(buf: &[usize]) -> Result<AuxVec, ()> {
return Ok(AuxVec { hwcap, hwcap2 });
}
}
drop(buf);
// Suppress unused variable
let _ = buf;
Err(())
}

Expand Down

0 comments on commit 5f5ddf8

Please sign in to comment.