Skip to content

Commit 711c569

Browse files
committed
Remove some unused bitset code.
1 parent 2611bf7 commit 711c569

File tree

1 file changed

+0
-51
lines changed

1 file changed

+0
-51
lines changed

compiler/rustc_index/src/bit_set.rs

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -973,48 +973,6 @@ impl<T: Idx> BitRelations<ChunkedBitSet<T>> for ChunkedBitSet<T> {
973973
}
974974
}
975975

976-
impl<T: Idx> BitRelations<ChunkedBitSet<T>> for DenseBitSet<T> {
977-
fn union(&mut self, other: &ChunkedBitSet<T>) -> bool {
978-
sequential_update(|elem| self.insert(elem), other.iter())
979-
}
980-
981-
fn subtract(&mut self, _other: &ChunkedBitSet<T>) -> bool {
982-
unimplemented!("implement if/when necessary");
983-
}
984-
985-
fn intersect(&mut self, other: &ChunkedBitSet<T>) -> bool {
986-
assert_eq!(self.domain_size(), other.domain_size);
987-
let mut changed = false;
988-
for (i, chunk) in other.chunks.iter().enumerate() {
989-
let mut words = &mut self.words[i * CHUNK_WORDS..];
990-
if words.len() > CHUNK_WORDS {
991-
words = &mut words[..CHUNK_WORDS];
992-
}
993-
match chunk {
994-
Zeros => {
995-
for word in words {
996-
if *word != 0 {
997-
changed = true;
998-
*word = 0;
999-
}
1000-
}
1001-
}
1002-
Ones => (),
1003-
Mixed(_, data) => {
1004-
for (i, word) in words.iter_mut().enumerate() {
1005-
let new_val = *word & data[i];
1006-
if new_val != *word {
1007-
changed = true;
1008-
*word = new_val;
1009-
}
1010-
}
1011-
}
1012-
}
1013-
}
1014-
changed
1015-
}
1016-
}
1017-
1018976
impl<T> Clone for ChunkedBitSet<T> {
1019977
fn clone(&self) -> Self {
1020978
ChunkedBitSet {
@@ -1125,15 +1083,6 @@ enum ChunkIter<'a> {
11251083
Finished,
11261084
}
11271085

1128-
// Applies a function to mutate a bitset, and returns true if any
1129-
// of the applications return true
1130-
fn sequential_update<T: Idx>(
1131-
mut self_update: impl FnMut(T) -> bool,
1132-
it: impl Iterator<Item = T>,
1133-
) -> bool {
1134-
it.fold(false, |changed, elem| self_update(elem) | changed)
1135-
}
1136-
11371086
impl<T: Idx> fmt::Debug for ChunkedBitSet<T> {
11381087
fn fmt(&self, w: &mut fmt::Formatter<'_>) -> fmt::Result {
11391088
w.debug_list().entries(self.iter()).finish()

0 commit comments

Comments
 (0)