From ed15716fe61e181b7c605c00e44ca208e2446db7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20S=C3=A1nchez=20Mu=C3=B1oz?= Date: Tue, 23 Apr 2024 17:47:46 +0200 Subject: [PATCH] Configure clippy not to generate warnings about arithmetic operations on `rustc_target::abi::Size` --- src/tools/miri/clippy.toml | 1 + src/tools/miri/src/shims/x86/mod.rs | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) create mode 100644 src/tools/miri/clippy.toml diff --git a/src/tools/miri/clippy.toml b/src/tools/miri/clippy.toml new file mode 100644 index 000000000000..284e18a45a30 --- /dev/null +++ b/src/tools/miri/clippy.toml @@ -0,0 +1 @@ +arithmetic-side-effects-allowed = ["rustc_target::abi::Size"] diff --git a/src/tools/miri/src/shims/x86/mod.rs b/src/tools/miri/src/shims/x86/mod.rs index a9d248c2a850..cf3c3758cd1d 100644 --- a/src/tools/miri/src/shims/x86/mod.rs +++ b/src/tools/miri/src/shims/x86/mod.rs @@ -985,8 +985,6 @@ fn mask_load<'tcx>( let dest = this.project_index(&dest, i)?; if this.read_scalar(&mask)?.to_uint(mask_item_size)? >> high_bit_offset != 0 { - // Size * u64 is implemented as always checked - #[allow(clippy::arithmetic_side_effects)] let ptr = ptr.wrapping_offset(dest.layout.size * i, &this.tcx); // Unaligned copy, which is what we want. this.mem_copy(ptr, dest.ptr(), dest.layout.size, /*nonoverlapping*/ true)?; @@ -1020,8 +1018,6 @@ fn mask_store<'tcx>( let value = this.project_index(&value, i)?; if this.read_scalar(&mask)?.to_uint(mask_item_size)? >> high_bit_offset != 0 { - // Size * u64 is implemented as always checked - #[allow(clippy::arithmetic_side_effects)] let ptr = ptr.wrapping_offset(value.layout.size * i, &this.tcx); // Unaligned copy, which is what we want. this.mem_copy(value.ptr(), ptr, value.layout.size, /*nonoverlapping*/ true)?;