Skip to content

Commit f1b944d

Browse files
committed
fmt
1 parent eed24ac commit f1b944d

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

src/tools/miri/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ pub use crate::machine::{
125125
};
126126
pub use crate::mono_hash_map::MonoHashMap;
127127
pub use crate::operator::EvalContextExt as _;
128-
pub use crate::provenance_gc::{EvalContextExt as _, VisitProvenance, VisitWith, LiveAllocs};
128+
pub use crate::provenance_gc::{EvalContextExt as _, LiveAllocs, VisitProvenance, VisitWith};
129129
pub use crate::range_map::RangeMap;
130130

131131
/// Insert rustc arguments at the beginning of the argument list that Miri wants to be

src/tools/miri/src/provenance_gc.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,13 @@ pub struct LiveAllocs<'a, 'mir, 'tcx> {
157157

158158
impl LiveAllocs<'_, '_, '_> {
159159
pub fn is_live(&self, id: AllocId) -> bool {
160-
self.collected.contains(&id) ||
161-
self.ecx.is_alloc_live(id)
160+
self.collected.contains(&id) || self.ecx.is_alloc_live(id)
162161
}
163162
}
164163

165164
impl<'mir, 'tcx: 'mir> EvalContextExt<'mir, 'tcx> for crate::MiriInterpCx<'mir, 'tcx> {}
166165
pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
167166
fn run_provenance_gc(&mut self) {
168-
169167
// We collect all tags from various parts of the interpreter, but also
170168
let this = self.eval_context_mut();
171169

@@ -196,10 +194,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> {
196194

197195
fn remove_unreachable_allocs(&mut self, allocs: FxHashSet<AllocId>) {
198196
let this = self.eval_context_ref();
199-
let allocs = LiveAllocs {
200-
ecx: this,
201-
collected: allocs,
202-
};
197+
let allocs = LiveAllocs { ecx: this, collected: allocs };
203198
this.machine.allocation_spans.borrow_mut().retain(|id, _| allocs.is_live(*id));
204199
this.machine.intptrcast.borrow_mut().remove_unreachable_allocs(&allocs);
205200
if let Some(borrow_tracker) = &this.machine.borrow_tracker {

src/tools/miri/tests/utils/mod.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,5 @@ pub use miri_extern::*;
1212

1313
pub fn run_provenance_gc() {
1414
// SAFETY: No preconditions. The GC is fine to run at any time.
15-
unsafe {
16-
miri_run_provenance_gc()
17-
}
15+
unsafe { miri_run_provenance_gc() }
1816
}

0 commit comments

Comments
 (0)