Skip to content

Commit d1f8a2c

Browse files
committed
document the use-cases of DenseBitSet a bit more
1 parent a13354b commit d1f8a2c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

compiler/rustc_index/src/bit_set.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,13 @@ macro_rules! bit_relations_inherent_impls {
9797

9898
/// A fixed-size bitset type with a dense representation.
9999
///
100-
/// NOTE: Use [`GrowableBitSet`] if you need support for resizing after creation.
100+
/// Note 1: Since this bitset is dense, if your domain is big, and/or relatively
101+
/// homogeneous (for example, with long runs of bits set or unset), then it may
102+
/// be preferable to instead use a [MixedBitSet], or an
103+
/// [IntervalSet](crate::interval::IntervalSet). They should be more suited to
104+
/// sparse, or highly-compressible, domains.
105+
///
106+
/// Note 2: Use [`GrowableBitSet`] if you need support for resizing after creation.
101107
///
102108
/// `T` is an index type, typically a newtyped `usize` wrapper, but it can also
103109
/// just be `usize`.

0 commit comments

Comments
 (0)