Skip to content

Commit cae4302

Browse files
committed
Fix & rebase
1 parent ed32b26 commit cae4302

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/data_race.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -176,19 +176,19 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
176176
let mut current_state = alloc.global.current_thread_state_mut();
177177
if atomic == AtomicReadOp::Relaxed {
178178
// Perform relaxed atomic load
179-
for range in alloc.alloc_ranges.get_mut().iter_mut(offset, size) {
179+
for (_,range) in alloc.alloc_ranges.get_mut().iter_mut(offset, size) {
180180
range.load_relaxed(&mut *current_state);
181181
}
182182
}else{
183183
// Perform acquire(or seq-cst) atomic load
184-
for range in alloc.alloc_ranges.get_mut().iter_mut(offset, size) {
184+
for (_,range) in alloc.alloc_ranges.get_mut().iter_mut(offset, size) {
185185
range.acquire(&mut *current_state);
186186
}
187187
}
188188

189189
// Log changes to atomic memory
190190
if log::log_enabled!(log::Level::Trace) {
191-
for range in alloc.alloc_ranges.get_mut().iter(offset, size) {
191+
for (_,range) in alloc.alloc_ranges.get_mut().iter(offset, size) {
192192
log::trace!(
193193
" updated atomic memory({:?}, offset={}, size={}) to {:#?}",
194194
place.ptr.assert_ptr().alloc_id, offset.bytes(), size.bytes(),
@@ -227,19 +227,19 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
227227

228228
if atomic == AtomicWriteOp::Relaxed {
229229
// Perform relaxed atomic store
230-
for range in alloc.alloc_ranges.get_mut().iter_mut(offset, size) {
230+
for (_,range) in alloc.alloc_ranges.get_mut().iter_mut(offset, size) {
231231
range.store_relaxed(&mut *current_state, current_thread);
232232
}
233233
}else{
234234
// Perform release(or seq-cst) atomic store
235-
for range in alloc.alloc_ranges.get_mut().iter_mut(offset, size) {
235+
for (_,range) in alloc.alloc_ranges.get_mut().iter_mut(offset, size) {
236236
range.release(&mut *current_state, current_thread);
237237
}
238238
}
239239

240240
// Log changes to atomic memory
241241
if log::log_enabled!(log::Level::Trace) {
242-
for range in alloc.alloc_ranges.get_mut().iter(offset, size) {
242+
for (_,range) in alloc.alloc_ranges.get_mut().iter(offset, size) {
243243
log::trace!(
244244
" updated atomic memory({:?}, offset={}, size={}) to {:#?}",
245245
place.ptr.assert_ptr().alloc_id, offset.bytes(), size.bytes(),
@@ -279,7 +279,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
279279

280280
let acquire = matches!(atomic, Acquire | AcqRel | SeqCst);
281281
let release = matches!(atomic, Release | AcqRel | SeqCst);
282-
for range in alloc.alloc_ranges.get_mut().iter_mut(offset, size) {
282+
for (_,range) in alloc.alloc_ranges.get_mut().iter_mut(offset, size) {
283283
//FIXME: this is probably still slightly wrong due to the quirks
284284
// in the c++11 memory model
285285
if acquire {
@@ -298,7 +298,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
298298

299299
// Log changes to atomic memory
300300
if log::log_enabled!(log::Level::Trace) {
301-
for range in alloc.alloc_ranges.get_mut().iter(offset, size) {
301+
for (_,range) in alloc.alloc_ranges.get_mut().iter(offset, size) {
302302
log::trace!(
303303
" updated atomic memory({:?}, offset={}, size={}) to {:#?}",
304304
place.ptr.assert_ptr().alloc_id, offset.bytes(), size.bytes(),
@@ -733,7 +733,7 @@ impl VClockAlloc {
733733
// The alloc-ranges are not split, however changes are not going to be made
734734
// to the ranges being tested, so this is ok
735735
let mut alloc_ranges = self.alloc_ranges.borrow_mut();
736-
for range in alloc_ranges.iter_mut(pointer.offset, len) {
736+
for (_,range) in alloc_ranges.iter_mut(pointer.offset, len) {
737737
if range.read_race_detect(&*current_state, current_thread) {
738738
// Report data-race
739739
return Self::report_data_race(
@@ -754,7 +754,7 @@ impl VClockAlloc {
754754
if self.global.multi_threaded.get() {
755755
let current_thread = self.global.current_thread();
756756
let current_state = self.global.current_thread_state();
757-
for range in self.alloc_ranges.get_mut().iter_mut(pointer.offset, len) {
757+
for (_,range) in self.alloc_ranges.get_mut().iter_mut(pointer.offset, len) {
758758
if range.write_race_detect(&*current_state, current_thread) {
759759
// Report data-race
760760
return Self::report_data_race(
@@ -775,7 +775,7 @@ impl VClockAlloc {
775775
if self.global.multi_threaded.get() {
776776
let current_thread = self.global.current_thread();
777777
let current_state = self.global.current_thread_state();
778-
for range in self.alloc_ranges.get_mut().iter_mut(pointer.offset, len) {
778+
for (_,range) in self.alloc_ranges.get_mut().iter_mut(pointer.offset, len) {
779779
if range.write_race_detect(&*current_state, current_thread) {
780780
// Report data-race
781781
return Self::report_data_race(

0 commit comments

Comments
 (0)