Skip to content

Commit e2b9d6e

Browse files
Add a contains method to ResultsCursor
1 parent e6ec0d1 commit e2b9d6e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/librustc_mir/dataflow/generic/cursor.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ where
6565
&self.state
6666
}
6767

68+
/// Returns `true` if the dataflow state at the current location contains the given element.
69+
///
70+
/// Shorthand for `self.get().contains(elem)`
71+
pub fn contains(&self, elem: A::Idx) -> bool {
72+
self.state.contains(elem)
73+
}
74+
6875
/// Resets the cursor to the start of the given basic block.
6976
pub fn seek_to_block_start(&mut self, block: BasicBlock) {
7077
self.state.overwrite(&self.results.borrow().entry_sets[block]);

0 commit comments

Comments
 (0)