Skip to content

Commit a238793

Browse files
committed
Auto merge of #2900 - oli-obk:rustup, r=oli-obk
Rustup
2 parents d4dfbea + 2166e34 commit a238793

File tree

17 files changed

+25
-27
lines changed

17 files changed

+25
-27
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
77c836e1ae582661924d3b6ec4d57a2de120f59f
1+
8b4b20836b832e91aa605a2faf5e2a55190202c8

src/shims/backtrace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
102102
let ptr_layout = this.layout_of(ptr_ty)?;
103103

104104
for (i, ptr) in ptrs.into_iter().enumerate() {
105-
let offset = ptr_layout.size * i.try_into().unwrap();
105+
let offset = ptr_layout.size.checked_mul(i.try_into().unwrap(), this).unwrap();
106106

107107
let op_place = buf_place.offset(offset, ptr_layout, this)?;
108108

src/shims/foreign_items.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
166166
dependency_format.1.iter().enumerate().filter_map(|(num, &linkage)| {
167167
// We add 1 to the number because that's what rustc also does everywhere it
168168
// calls `CrateNum::new`...
169-
#[allow(clippy::integer_arithmetic)]
169+
#[allow(clippy::arithmetic_side_effects)]
170170
(linkage != Linkage::NotLinked).then_some(CrateNum::new(num + 1))
171171
}),
172172
) {
@@ -707,7 +707,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
707707
.position(|&c| c == val)
708708
{
709709
let idx = u64::try_from(idx).unwrap();
710-
#[allow(clippy::integer_arithmetic)] // idx < num, so this never wraps
710+
#[allow(clippy::arithmetic_side_effects)] // idx < num, so this never wraps
711711
let new_ptr = ptr.offset(Size::from_bytes(num - idx - 1), this)?;
712712
this.write_pointer(new_ptr, dest)?;
713713
} else {
@@ -916,10 +916,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
916916
let a = this.read_scalar(a)?.to_u64()?;
917917
let b = this.read_scalar(b)?.to_u64()?;
918918

919-
#[allow(clippy::integer_arithmetic)]
919+
#[allow(clippy::arithmetic_side_effects)]
920920
// adding two u64 and a u8 cannot wrap in a u128
921921
let wide_sum = u128::from(c_in) + u128::from(a) + u128::from(b);
922-
#[allow(clippy::integer_arithmetic)] // it's a u128, we can shift by 64
922+
#[allow(clippy::arithmetic_side_effects)] // it's a u128, we can shift by 64
923923
let (c_out, sum) = ((wide_sum >> 64).truncate::<u8>(), wide_sum.truncate::<u64>());
924924

925925
let c_out_field = this.place_field(dest, 0)?;

src/shims/intrinsics/simd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ fn simd_bitmask_index(idx: u32, vec_len: u32, endianness: Endian) -> u32 {
612612
assert!(idx < vec_len);
613613
match endianness {
614614
Endian::Little => idx,
615-
#[allow(clippy::integer_arithmetic)] // idx < vec_len
615+
#[allow(clippy::arithmetic_side_effects)] // idx < vec_len
616616
Endian::Big => vec_len - 1 - idx, // reverse order of bits
617617
}
618618
}

src/shims/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![warn(clippy::integer_arithmetic)]
1+
#![warn(clippy::arithmetic_side_effects)]
22

33
mod backtrace;
44
#[cfg(target_os = "linux")]

src/shims/time.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
108108
Ok(0)
109109
}
110110

111-
#[allow(non_snake_case, clippy::integer_arithmetic)]
111+
#[allow(non_snake_case, clippy::arithmetic_side_effects)]
112112
fn GetSystemTimeAsFileTime(
113113
&mut self,
114114
LPFILETIME_op: &OpTy<'tcx, Provenance>,

src/shims/tls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl<'tcx> Default for TlsData<'tcx> {
5656
impl<'tcx> TlsData<'tcx> {
5757
/// Generate a new TLS key with the given destructor.
5858
/// `max_size` determines the integer size the key has to fit in.
59-
#[allow(clippy::integer_arithmetic)]
59+
#[allow(clippy::arithmetic_side_effects)]
6060
pub fn create_tls_key(
6161
&mut self,
6262
dtor: Option<ty::Instance<'tcx>>,

src/shims/unix/fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ pub struct DirHandler {
458458
}
459459

460460
impl DirHandler {
461-
#[allow(clippy::integer_arithmetic)]
461+
#[allow(clippy::arithmetic_side_effects)]
462462
fn insert_new(&mut self, read_dir: ReadDir) -> u64 {
463463
let id = self.next_id;
464464
self.next_id += 1;

src/shims/unix/linux/sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ pub fn futex<'tcx>(
247247
// before doing the syscall.
248248
this.atomic_fence(AtomicFenceOrd::SeqCst)?;
249249
let mut n = 0;
250-
#[allow(clippy::integer_arithmetic)]
250+
#[allow(clippy::arithmetic_side_effects)]
251251
for _ in 0..val {
252252
if let Some(thread) = this.futex_wake(addr_usize, bitset) {
253253
this.unblock_thread(thread);

src/shims/windows/foreign_items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
219219
.copied()
220220
.scan(Size::ZERO, |a, x| {
221221
let res = Some(*a);
222-
*a += x;
222+
*a = a.checked_add(x, this).unwrap();
223223
res
224224
})
225225
.collect();

0 commit comments

Comments
 (0)