Skip to content

Commit e4843a9

Browse files
committed
Remove ResultsCursor::contains.
It's hardly worth it, and it needs to be removed so that `GenKillAnalysis` can be removed.
1 parent a1eceec commit e4843a9

File tree

4 files changed

+3
-14
lines changed

4 files changed

+3
-14
lines changed

compiler/rustc_mir_dataflow/src/framework/cursor.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use rustc_index::bit_set::BitSet;
77
use rustc_middle::mir::{self, BasicBlock, Location};
88

99
use super::{Analysis, Direction, Effect, EffectIndex, Results};
10-
use crate::framework::BitSetExt;
1110

1211
/// Allows random access inspection of the results of a dataflow analysis.
1312
///
@@ -221,16 +220,6 @@ where
221220
}
222221
}
223222

224-
impl<'mir, 'tcx, A> ResultsCursor<'mir, 'tcx, A>
225-
where
226-
A: crate::GenKillAnalysis<'tcx>,
227-
A::Domain: BitSetExt<A::Idx>,
228-
{
229-
pub fn contains(&self, elem: A::Idx) -> bool {
230-
self.get().contains(elem)
231-
}
232-
}
233-
234223
#[derive(Clone, Copy, Debug)]
235224
struct CursorPosition {
236225
block: BasicBlock,

compiler/rustc_mir_dataflow/src/impls/storage_liveness.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ where
364364
fn visit_local(&mut self, local: Local, context: PlaceContext, loc: Location) {
365365
if PlaceContext::NonMutatingUse(NonMutatingUseContext::Move) == context {
366366
self.borrowed_locals.seek_before_primary_effect(loc);
367-
if !self.borrowed_locals.contains(local) {
367+
if !self.borrowed_locals.get().contains(local) {
368368
self.trans.kill(local);
369369
}
370370
}

compiler/rustc_mir_transform/src/elaborate_drops.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl InitializationData<'_, '_> {
133133
}
134134

135135
fn maybe_live_dead(&self, path: MovePathIndex) -> (bool, bool) {
136-
(self.inits.contains(path), self.uninits.contains(path))
136+
(self.inits.get().contains(path), self.uninits.get().contains(path))
137137
}
138138
}
139139

compiler/rustc_mir_transform/src/ref_prop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ fn compute_replacement<'tcx>(
179179
} else {
180180
// This is a proper dereference. We can only allow it if `target` is live.
181181
maybe_dead.seek_after_primary_effect(loc);
182-
let maybe_dead = maybe_dead.contains(target.local);
182+
let maybe_dead = maybe_dead.get().contains(target.local);
183183
!maybe_dead
184184
}
185185
};

0 commit comments

Comments
 (0)