From 6ba56ac7b900d04afec2f9c81323e8508ce74109 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 18 Jul 2023 11:25:17 +0200 Subject: [PATCH] fix clippy warnings --- src/tools/miri/src/borrow_tracker/mod.rs | 4 ++-- src/tools/miri/src/borrow_tracker/stacked_borrows/mod.rs | 6 +++--- src/tools/miri/src/shims/unix/sync.rs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/tools/miri/src/borrow_tracker/mod.rs b/src/tools/miri/src/borrow_tracker/mod.rs index fcfa8f64570..b6dfd9944ee 100644 --- a/src/tools/miri/src/borrow_tracker/mod.rs +++ b/src/tools/miri/src/borrow_tracker/mod.rs @@ -413,7 +413,7 @@ pub fn before_memory_write<'tcx>( alloc_id: AllocId, prov_extra: ProvenanceExtra, range: AllocRange, - machine: &mut MiriMachine<'_, 'tcx>, + machine: &MiriMachine<'_, 'tcx>, ) -> InterpResult<'tcx> { match self { AllocState::StackedBorrows(sb) => @@ -434,7 +434,7 @@ pub fn before_memory_deallocation<'tcx>( alloc_id: AllocId, prov_extra: ProvenanceExtra, range: AllocRange, - machine: &mut MiriMachine<'_, 'tcx>, + machine: &MiriMachine<'_, 'tcx>, ) -> InterpResult<'tcx> { match self { AllocState::StackedBorrows(sb) => diff --git a/src/tools/miri/src/borrow_tracker/stacked_borrows/mod.rs b/src/tools/miri/src/borrow_tracker/stacked_borrows/mod.rs index 15a7d72edf1..7e89d3a0e8c 100644 --- a/src/tools/miri/src/borrow_tracker/stacked_borrows/mod.rs +++ b/src/tools/miri/src/borrow_tracker/stacked_borrows/mod.rs @@ -244,7 +244,7 @@ fn find_first_write_incompatible(&self, granting: usize) -> usize { fn item_invalidated( item: &Item, global: &GlobalStateInner, - dcx: &mut DiagnosticCx<'_, '_, '_, 'tcx>, + dcx: &DiagnosticCx<'_, '_, '_, 'tcx>, cause: ItemInvalidationCause, ) -> InterpResult<'tcx> { if !global.tracked_pointer_tags.is_empty() { @@ -575,7 +575,7 @@ pub fn before_memory_write<'tcx>( alloc_id: AllocId, tag: ProvenanceExtra, range: AllocRange, - machine: &mut MiriMachine<'_, 'tcx>, + machine: &MiriMachine<'_, 'tcx>, ) -> InterpResult<'tcx> { trace!( "write access with tag {:?}: {:?}, size {}", @@ -596,7 +596,7 @@ pub fn before_memory_deallocation<'tcx>( alloc_id: AllocId, tag: ProvenanceExtra, range: AllocRange, - machine: &mut MiriMachine<'_, 'tcx>, + machine: &MiriMachine<'_, 'tcx>, ) -> InterpResult<'tcx> { trace!("deallocation with tag {:?}: {:?}, size {}", tag, alloc_id, range.size.bytes()); let dcx = DiagnosticCxBuilder::dealloc(machine, tag); diff --git a/src/tools/miri/src/shims/unix/sync.rs b/src/tools/miri/src/shims/unix/sync.rs index 94b831da5c8..1fa0ffd8ee7 100644 --- a/src/tools/miri/src/shims/unix/sync.rs +++ b/src/tools/miri/src/shims/unix/sync.rs @@ -18,14 +18,14 @@ const PTHREAD_MUTEX_NORMAL_FLAG: i32 = 0x8000000; fn is_mutex_kind_default<'mir, 'tcx: 'mir>( - ecx: &mut MiriInterpCx<'mir, 'tcx>, + ecx: &MiriInterpCx<'mir, 'tcx>, kind: i32, ) -> InterpResult<'tcx, bool> { Ok(kind == ecx.eval_libc_i32("PTHREAD_MUTEX_DEFAULT")) } fn is_mutex_kind_normal<'mir, 'tcx: 'mir>( - ecx: &mut MiriInterpCx<'mir, 'tcx>, + ecx: &MiriInterpCx<'mir, 'tcx>, kind: i32, ) -> InterpResult<'tcx, bool> { let mutex_normal_kind = ecx.eval_libc_i32("PTHREAD_MUTEX_NORMAL");