diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-11-13 16:24:16 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-11-13 16:24:16 +1100 |
| commit | 06faf589acda706f9fa556d2cbeba50f99e6c34c (patch) | |
| tree | 2b02538d42d19a41cc7d1d5f027ba5f5b9126b1c | |
| parent | 2b603f95a48f10f931a61dd208fe3e5ffd64e491 (diff) | |
| download | rust-06faf589acda706f9fa556d2cbeba50f99e6c34c.tar.gz rust-06faf589acda706f9fa556d2cbeba50f99e6c34c.zip | |
Remove `BitSet::words`.
| -rw-r--r-- | compiler/rustc_index/src/bit_set.rs | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/compiler/rustc_index/src/bit_set.rs b/compiler/rustc_index/src/bit_set.rs index ece61ff1252..af8a53a991f 100644 --- a/compiler/rustc_index/src/bit_set.rs +++ b/compiler/rustc_index/src/bit_set.rs @@ -237,11 +237,6 @@ impl<T: Idx> BitSet<T> { new_word != word } - /// Gets a slice of the underlying words. - pub fn words(&self) -> &[Word] { - &self.words - } - /// Iterates over the indices of set bits in a sorted order. #[inline] pub fn iter(&self) -> BitIter<'_, T> { @@ -1601,11 +1596,11 @@ impl<R: Idx, C: Idx> BitMatrix<R, C> { pub fn from_row_n(row: &BitSet<C>, num_rows: usize) -> BitMatrix<R, C> { let num_columns = row.domain_size(); let words_per_row = num_words(num_columns); - assert_eq!(words_per_row, row.words().len()); + assert_eq!(words_per_row, row.words.len()); BitMatrix { num_rows, num_columns, - words: iter::repeat(row.words()).take(num_rows).flatten().cloned().collect(), + words: iter::repeat(&row.words).take(num_rows).flatten().cloned().collect(), marker: PhantomData, } } @@ -1700,9 +1695,9 @@ impl<R: Idx, C: Idx> BitMatrix<R, C> { assert_eq!(with.domain_size(), self.num_columns); let (write_start, write_end) = self.range(write); let mut changed = false; - for (read_index, write_index) in iter::zip(0..with.words().len(), write_start..write_end) { + for (read_index, write_index) in iter::zip(0..with.words.len(), write_start..write_end) { let word = self.words[write_index]; - let new_word = word | with.words()[read_index]; + let new_word = word | with.words[read_index]; self.words[write_index] = new_word; changed |= word != new_word; } |
