Configure clippy not to generate warnings about arithmetic operations on rustc_target::abi::Size

This commit is contained in:
Eduardo Sánchez Muñoz 2024-04-23 17:47:46 +02:00
parent 799a4ded54
commit ed15716fe6
2 changed files with 1 additions and 4 deletions

View File

@ -0,0 +1 @@
arithmetic-side-effects-allowed = ["rustc_target::abi::Size"]

View File

@ -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)?;