diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2025-01-11 18:13:47 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-11 18:13:47 +0100 |
| commit | 0bb0f0412fcf970dd8997281a4e30b4059ca6e5d (patch) | |
| tree | 2ad83f26990f710592a8bbcb7dce7fb1a2f31459 /compiler/rustc_data_structures/src/work_queue.rs | |
| parent | 2bcd5cf1ecf684511d0a842ce5495a1595e0ce95 (diff) | |
| parent | 95cbb3b96425fe173a9d868b72caf9efc4d1615f (diff) | |
| download | rust-0bb0f0412fcf970dd8997281a4e30b4059ca6e5d.tar.gz rust-0bb0f0412fcf970dd8997281a4e30b4059ca6e5d.zip | |
Rollup merge of #135205 - lqd:bitsets, r=Mark-Simulacrum
Rename `BitSet` to `DenseBitSet` r? `@Mark-Simulacrum` as you requested this in https://github.com/rust-lang/rust/pull/134438#discussion_r1890659739 after such a confusion. This PR renames `BitSet` to `DenseBitSet` to make it less obvious as the go-to solution for bitmap needs, as well as make its representation (and positives/negatives) clearer. It also expands the comments there to hopefully make it clearer when it's not a good fit, with some alternative bitsets types. (This migrates the subtrees cg_gcc and clippy to use the new name in separate commits, for easier review by their respective owners, but they can obvs be squashed)
Diffstat (limited to 'compiler/rustc_data_structures/src/work_queue.rs')
| -rw-r--r-- | compiler/rustc_data_structures/src/work_queue.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_data_structures/src/work_queue.rs b/compiler/rustc_data_structures/src/work_queue.rs index ca052e2eac6..815756edfeb 100644 --- a/compiler/rustc_data_structures/src/work_queue.rs +++ b/compiler/rustc_data_structures/src/work_queue.rs @@ -1,7 +1,7 @@ use std::collections::VecDeque; use rustc_index::Idx; -use rustc_index::bit_set::BitSet; +use rustc_index::bit_set::DenseBitSet; /// A work queue is a handy data structure for tracking work left to /// do. (For example, basic blocks left to process.) It is basically a @@ -11,14 +11,14 @@ use rustc_index::bit_set::BitSet; /// and also use a bit set to track occupancy. pub struct WorkQueue<T: Idx> { deque: VecDeque<T>, - set: BitSet<T>, + set: DenseBitSet<T>, } impl<T: Idx> WorkQueue<T> { /// Creates a new work queue that starts empty, where elements range from (0..len). #[inline] pub fn with_none(len: usize) -> Self { - WorkQueue { deque: VecDeque::with_capacity(len), set: BitSet::new_empty(len) } + WorkQueue { deque: VecDeque::with_capacity(len), set: DenseBitSet::new_empty(len) } } /// Attempt to enqueue `element` in the work queue. Returns false if it was already present. |
