about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEduardo Sánchez Muñoz <eduardosm-dev@e64.io>2024-04-23 17:47:46 +0200
committerEduardo Sánchez Muñoz <eduardosm-dev@e64.io>2024-04-23 18:59:53 +0200
commited15716fe61e181b7c605c00e44ca208e2446db7 (patch)
treec3043ff891897436d1e28dbb8829b5528b5d952e
parent799a4ded54147daf6aa84b08490d8b60163a73e9 (diff)
downloadrust-ed15716fe61e181b7c605c00e44ca208e2446db7.tar.gz
rust-ed15716fe61e181b7c605c00e44ca208e2446db7.zip
Configure clippy not to generate warnings about arithmetic operations on `rustc_target::abi::Size`
-rw-r--r--src/tools/miri/clippy.toml1
-rw-r--r--src/tools/miri/src/shims/x86/mod.rs4
2 files changed, 1 insertions, 4 deletions
diff --git a/src/tools/miri/clippy.toml b/src/tools/miri/clippy.toml
new file mode 100644
index 00000000000..284e18a45a3
--- /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 a9d248c2a85..cf3c3758cd1 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)?;