diff options
| author | Ralf Jung <post@ralfj.de> | 2023-11-21 18:24:57 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2023-11-21 18:24:57 +0100 |
| commit | f1b944d1a2364f4baf4d1d9ce421fc4126adc6f5 (patch) | |
| tree | 9afb6a02f553db48a41cc7c6eab6071a82bb8e2b /src/tools | |
| parent | eed24ac572eba9b6505525e08cc4b7b91c34e428 (diff) | |
| download | rust-f1b944d1a2364f4baf4d1d9ce421fc4126adc6f5.tar.gz rust-f1b944d1a2364f4baf4d1d9ce421fc4126adc6f5.zip | |
fmt
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/miri/src/lib.rs | 2 | ||||
| -rw-r--r-- | src/tools/miri/src/provenance_gc.rs | 9 | ||||
| -rw-r--r-- | src/tools/miri/tests/utils/mod.rs | 4 |
3 files changed, 4 insertions, 11 deletions
diff --git a/src/tools/miri/src/lib.rs b/src/tools/miri/src/lib.rs index 119ec555b2e..70e9c443e90 100644 --- a/src/tools/miri/src/lib.rs +++ b/src/tools/miri/src/lib.rs @@ -125,7 +125,7 @@ pub use crate::machine::{ }; pub use crate::mono_hash_map::MonoHashMap; pub use crate::operator::EvalContextExt as _; -pub use crate::provenance_gc::{EvalContextExt as _, VisitProvenance, VisitWith, LiveAllocs}; +pub use crate::provenance_gc::{EvalContextExt as _, LiveAllocs, VisitProvenance, VisitWith}; pub use crate::range_map::RangeMap; /// Insert rustc arguments at the beginning of the argument list that Miri wants to be diff --git a/src/tools/miri/src/provenance_gc.rs b/src/tools/miri/src/provenance_gc.rs index eac4aad27a0..4456e641b00 100644 --- a/src/tools/miri/src/provenance_gc.rs +++ b/src/tools/miri/src/provenance_gc.rs @@ -157,15 +157,13 @@ pub struct LiveAllocs<'a, 'mir, 'tcx> { impl LiveAllocs<'_, '_, '_> { pub fn is_live(&self, id: AllocId) -> bool { - self.collected.contains(&id) || - self.ecx.is_alloc_live(id) + self.collected.contains(&id) || self.ecx.is_alloc_live(id) } } impl<'mir, 'tcx: 'mir> EvalContextExt<'mir, 'tcx> for crate::MiriInterpCx<'mir, 'tcx> {} pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> { fn run_provenance_gc(&mut self) { - // We collect all tags from various parts of the interpreter, but also let this = self.eval_context_mut(); @@ -196,10 +194,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriInterpCxExt<'mir, 'tcx> { fn remove_unreachable_allocs(&mut self, allocs: FxHashSet<AllocId>) { let this = self.eval_context_ref(); - let allocs = LiveAllocs { - ecx: this, - collected: allocs, - }; + let allocs = LiveAllocs { ecx: this, collected: allocs }; this.machine.allocation_spans.borrow_mut().retain(|id, _| allocs.is_live(*id)); this.machine.intptrcast.borrow_mut().remove_unreachable_allocs(&allocs); if let Some(borrow_tracker) = &this.machine.borrow_tracker { diff --git a/src/tools/miri/tests/utils/mod.rs b/src/tools/miri/tests/utils/mod.rs index 6386162e095..3b817667f13 100644 --- a/src/tools/miri/tests/utils/mod.rs +++ b/src/tools/miri/tests/utils/mod.rs @@ -12,7 +12,5 @@ pub use miri_extern::*; pub fn run_provenance_gc() { // SAFETY: No preconditions. The GC is fine to run at any time. - unsafe { - miri_run_provenance_gc() - } + unsafe { miri_run_provenance_gc() } } |
