Struct rustc_pattern_analysis::index::IdxSet
source · pub struct IdxSet<T> {
domain_size: usize,
words: SmallVec<[u64; 2]>,
marker: PhantomData<T>,
}
Expand description
A fixed-size bitset type with a dense representation.
NOTE: Use GrowableBitSet
if you need support for resizing after creation.
T
is an index type, typically a newtyped usize
wrapper, but it can also
just be usize
.
All operations that involve an element will panic if the element is equal to or greater than the domain size. All operations that involve two bitsets will panic if the bitsets have differing domain sizes.
Fields§
§domain_size: usize
§words: SmallVec<[u64; 2]>
§marker: PhantomData<T>
Implementations§
source§impl<T> BitSet<T>where
T: Idx,
impl<T> BitSet<T>where
T: Idx,
sourcepub fn new_empty(domain_size: usize) -> BitSet<T>
pub fn new_empty(domain_size: usize) -> BitSet<T>
Creates a new, empty bitset with a given domain_size
.
sourcepub fn new_filled(domain_size: usize) -> BitSet<T>
pub fn new_filled(domain_size: usize) -> BitSet<T>
Creates a new, filled bitset with a given domain_size
.
pub fn insert_range(&mut self, elems: impl RangeBounds<T>)
sourcepub fn insert_all(&mut self)
pub fn insert_all(&mut self)
Sets all bits to true.
pub fn last_set_in(&self, range: impl RangeBounds<T>) -> Option<T>
sourcepub fn union<Rhs>(&mut self, other: &Rhs) -> boolwhere
BitSet<T>: BitRelations<Rhs>,
pub fn union<Rhs>(&mut self, other: &Rhs) -> boolwhere
BitSet<T>: BitRelations<Rhs>,
Sets self = self | other
and returns true
if self
changed
(i.e., if new bits were added).
Trait Implementations§
source§impl<T> BitRelations<ChunkedBitSet<T>> for BitSet<T>where
T: Idx,
impl<T> BitRelations<ChunkedBitSet<T>> for BitSet<T>where
T: Idx,
fn union(&mut self, other: &ChunkedBitSet<T>) -> bool
fn subtract(&mut self, _other: &ChunkedBitSet<T>) -> bool
fn intersect(&mut self, other: &ChunkedBitSet<T>) -> bool
source§impl<T> BitRelations<HybridBitSet<T>> for BitSet<T>where
T: Idx,
impl<T> BitRelations<HybridBitSet<T>> for BitSet<T>where
T: Idx,
fn union(&mut self, other: &HybridBitSet<T>) -> bool
fn subtract(&mut self, other: &HybridBitSet<T>) -> bool
fn intersect(&mut self, other: &HybridBitSet<T>) -> bool
source§impl<T> From<GrowableBitSet<T>> for BitSet<T>where
T: Idx,
impl<T> From<GrowableBitSet<T>> for BitSet<T>where
T: Idx,
source§fn from(bit_set: GrowableBitSet<T>) -> BitSet<T>
fn from(bit_set: GrowableBitSet<T>) -> BitSet<T>
source§impl<I, CTX> HashStable<CTX> for BitSet<I>where
I: Idx,
impl<I, CTX> HashStable<CTX> for BitSet<I>where
I: Idx,
fn hash_stable(&self, _ctx: &mut CTX, hasher: &mut StableHasher)
source§impl<T> PartialEq for BitSet<T>where
T: PartialEq,
impl<T> PartialEq for BitSet<T>where
T: PartialEq,
impl<T> Eq for BitSet<T>where
T: Eq,
impl<T> StructuralPartialEq for BitSet<T>
Auto Trait Implementations§
impl<T> DynSend for BitSet<T>where
T: DynSend,
impl<T> DynSync for BitSet<T>where
T: DynSync,
impl<T> Freeze for BitSet<T>
impl<T> RefUnwindSafe for BitSet<T>where
T: RefUnwindSafe,
impl<T> Send for BitSet<T>where
T: Send,
impl<T> Sync for BitSet<T>where
T: Sync,
impl<T> Unpin for BitSet<T>where
T: Unpin,
impl<T> UnwindSafe for BitSet<T>where
T: UnwindSafe,
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
source§impl<Tcx, T> DepNodeParams<Tcx> for T
impl<Tcx, T> DepNodeParams<Tcx> for T
default fn fingerprint_style() -> FingerprintStyle
source§default fn to_fingerprint(&self, tcx: Tcx) -> Fingerprint
default fn to_fingerprint(&self, tcx: Tcx) -> Fingerprint
default fn to_debug_str(&self, _: Tcx) -> String
source§default fn recover(_: Tcx, _: &DepNode) -> Option<T>
default fn recover(_: Tcx, _: &DepNode) -> Option<T>
DepNode
,
something which is needed when forcing DepNode
s during red-green
evaluation. The query system will only call this method if
fingerprint_style()
is not FingerprintStyle::Opaque
.
It is always valid to return None
here, in which case incremental
compilation will treat the query as having changed instead of forcing it.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Filterable for T
impl<T> Filterable for T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<P> IntoQueryParam<P> for P
impl<P> IntoQueryParam<P> for P
fn into_query_param(self) -> P
source§impl<T> MaybeResult<T> for T
impl<T> MaybeResult<T> for T
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<'tcx, T> ToPredicate<'tcx, T> for T
impl<'tcx, T> ToPredicate<'tcx, T> for T
fn to_predicate(self, _tcx: TyCtxt<'tcx>) -> T
source§impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
default fn from_cycle_error( tcx: Tcx, cycle_error: &CycleError, _guar: ErrorGuaranteed ) -> T
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes