Skip to content

Commit bf5789a

Browse files
committed
clippy suggestions
1 parent 24c18d0 commit bf5789a

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

src/borrow_tracker/mod.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ impl Method {
242242
})
243243
}
244244

245-
pub fn new_allocation<'b, 'mir, 'tcx>(
245+
pub fn new_allocation<'mir, 'tcx>(
246246
self,
247247
id: AllocId,
248248
alloc: &Allocation,
@@ -276,24 +276,21 @@ impl State {
276276
}
277277
}
278278

279-
pub fn before_memory_read<'tcx, 'mir, 'ecx>(
279+
pub fn before_memory_read<'tcx, 'mir>(
280280
&self,
281281
alloc_id: AllocId,
282282
prov_extra: ProvenanceExtra,
283283
range: AllocRange,
284284
state: &GlobalState,
285285
machine: &MiriMachine<'mir, 'tcx>,
286-
) -> InterpResult<'tcx>
287-
where
288-
'tcx: 'ecx,
289-
{
286+
) -> InterpResult<'tcx> {
290287
match self {
291288
State::Stack(sb) =>
292289
sb.borrow_mut().before_memory_read(alloc_id, prov_extra, range, state, machine),
293290
}
294291
}
295292

296-
pub fn before_memory_write<'tcx, 'mir, 'ecx>(
293+
pub fn before_memory_write<'tcx, 'mir>(
297294
&mut self,
298295
alloc_id: AllocId,
299296
prov_extra: ProvenanceExtra,
@@ -307,7 +304,7 @@ impl State {
307304
}
308305
}
309306

310-
pub fn before_memory_deallocation<'tcx, 'mir, 'ecx>(
307+
pub fn before_memory_deallocation<'tcx, 'mir>(
311308
&mut self,
312309
alloc_id: AllocId,
313310
prov_extra: ProvenanceExtra,
@@ -323,7 +320,7 @@ impl State {
323320

324321
pub fn remove_unreachable_tags(&self, tags: &FxHashSet<BorTag>) {
325322
match self {
326-
State::Stack(sb) => sb.borrow_mut().remove_unreachable_tags(&tags),
323+
State::Stack(sb) => sb.borrow_mut().remove_unreachable_tags(tags),
327324
}
328325
}
329326

src/machine.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> {
479479
});
480480
let rng = StdRng::seed_from_u64(config.seed.unwrap_or(0));
481481
let borrow_tracker_method = config.borrow_tracker;
482-
let borrow_tracker_data = borrow_tracker_method.instanciate_global_state(&config);
482+
let borrow_tracker_data = borrow_tracker_method.instanciate_global_state(config);
483483
let data_race = config.data_race_detector.then(|| data_race::GlobalState::new(config));
484484
MiriMachine {
485485
tcx: layout_cx.tcx,
@@ -916,11 +916,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for MiriMachine<'mir, 'tcx> {
916916
let buffer_alloc = ecx.machine.weak_memory.then(weak_memory::AllocExtra::new_allocation);
917917
let alloc: Allocation<Provenance, Self::AllocExtra> = alloc.adjust_from_tcx(
918918
&ecx.tcx,
919-
AllocExtra {
920-
borrow_tracker: borrow_tracker,
921-
data_race: race_alloc,
922-
weak_memory: buffer_alloc,
923-
},
919+
AllocExtra { borrow_tracker, data_race: race_alloc, weak_memory: buffer_alloc },
924920
|ptr| ecx.global_base_pointer(ptr),
925921
)?;
926922
Ok(Cow::Owned(alloc))

0 commit comments

Comments
 (0)