Struct rustc_middle::ty::VariantFlags
source · [−]pub struct VariantFlags {
bits: u32,
}
Fields
bits: u32
Implementations
sourceimpl VariantFlags
impl VariantFlags
pub const NO_VARIANT_FLAGS: VariantFlags = VariantFlags{bits: 0,}
sourcepub const IS_FIELD_LIST_NON_EXHAUSTIVE: VariantFlags = VariantFlags{bits: 1 << 0,}
pub const IS_FIELD_LIST_NON_EXHAUSTIVE: VariantFlags = VariantFlags{bits: 1 << 0,}
Indicates whether the field list of this variant is #[non_exhaustive]
.
sourcepub const IS_RECOVERED: VariantFlags = VariantFlags{bits: 1 << 1,}
pub const IS_RECOVERED: VariantFlags = VariantFlags{bits: 1 << 1,}
Indicates whether this variant was obtained as part of recovering from a syntactic error. May be incomplete or bogus.
sourcepub const fn empty() -> VariantFlags
pub const fn empty() -> VariantFlags
Returns an empty set of flags
sourcepub const fn all() -> VariantFlags
pub const fn all() -> VariantFlags
Returns the set containing all flags.
sourcepub fn from_bits(bits: u32) -> Option<VariantFlags>
pub fn from_bits(bits: u32) -> Option<VariantFlags>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
sourcepub const fn from_bits_truncate(bits: u32) -> VariantFlags
pub const fn from_bits_truncate(bits: u32) -> VariantFlags
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
sourcepub const unsafe fn from_bits_unchecked(bits: u32) -> VariantFlags
pub const unsafe fn from_bits_unchecked(bits: u32) -> VariantFlags
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
sourcepub const fn intersects(&self, other: VariantFlags) -> bool
pub const fn intersects(&self, other: VariantFlags) -> bool
Returns true
if there are flags common to both self
and other
.
sourcepub const fn contains(&self, other: VariantFlags) -> bool
pub const fn contains(&self, other: VariantFlags) -> bool
Returns true
all of the flags in other
are contained within self
.
sourcepub fn insert(&mut self, other: VariantFlags)
pub fn insert(&mut self, other: VariantFlags)
Inserts the specified flags in-place.
sourcepub fn remove(&mut self, other: VariantFlags)
pub fn remove(&mut self, other: VariantFlags)
Removes the specified flags in-place.
sourcepub fn toggle(&mut self, other: VariantFlags)
pub fn toggle(&mut self, other: VariantFlags)
Toggles the specified flags in-place.
sourcepub fn set(&mut self, other: VariantFlags, value: bool)
pub fn set(&mut self, other: VariantFlags, value: bool)
Inserts or removes the specified flags depending on the passed value.
Trait Implementations
sourceimpl Binary for VariantFlags
impl Binary for VariantFlags
sourceimpl BitAnd<VariantFlags> for VariantFlags
impl BitAnd<VariantFlags> for VariantFlags
sourcefn bitand(self, other: VariantFlags) -> VariantFlags
fn bitand(self, other: VariantFlags) -> VariantFlags
Returns the intersection between the two sets of flags.
type Output = VariantFlags
type Output = VariantFlags
The resulting type after applying the &
operator.
sourceimpl BitAndAssign<VariantFlags> for VariantFlags
impl BitAndAssign<VariantFlags> for VariantFlags
sourcefn bitand_assign(&mut self, other: VariantFlags)
fn bitand_assign(&mut self, other: VariantFlags)
Disables all flags disabled in the set.
sourceimpl BitOr<VariantFlags> for VariantFlags
impl BitOr<VariantFlags> for VariantFlags
sourcefn bitor(self, other: VariantFlags) -> VariantFlags
fn bitor(self, other: VariantFlags) -> VariantFlags
Returns the union of the two sets of flags.
type Output = VariantFlags
type Output = VariantFlags
The resulting type after applying the |
operator.
sourceimpl BitOrAssign<VariantFlags> for VariantFlags
impl BitOrAssign<VariantFlags> for VariantFlags
sourcefn bitor_assign(&mut self, other: VariantFlags)
fn bitor_assign(&mut self, other: VariantFlags)
Adds the set of flags.
sourceimpl BitXor<VariantFlags> for VariantFlags
impl BitXor<VariantFlags> for VariantFlags
sourcefn bitxor(self, other: VariantFlags) -> VariantFlags
fn bitxor(self, other: VariantFlags) -> VariantFlags
Returns the left flags, but with all the right flags toggled.
type Output = VariantFlags
type Output = VariantFlags
The resulting type after applying the ^
operator.
sourceimpl BitXorAssign<VariantFlags> for VariantFlags
impl BitXorAssign<VariantFlags> for VariantFlags
sourcefn bitxor_assign(&mut self, other: VariantFlags)
fn bitxor_assign(&mut self, other: VariantFlags)
Toggles the set of flags.
sourceimpl Clone for VariantFlags
impl Clone for VariantFlags
sourcefn clone(&self) -> VariantFlags
fn clone(&self) -> VariantFlags
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for VariantFlags
impl Debug for VariantFlags
sourceimpl<'tcx, __D: TyDecoder<'tcx>> Decodable<__D> for VariantFlags
impl<'tcx, __D: TyDecoder<'tcx>> Decodable<__D> for VariantFlags
sourceimpl<'tcx, __E: TyEncoder<'tcx>> Encodable<__E> for VariantFlags
impl<'tcx, __E: TyEncoder<'tcx>> Encodable<__E> for VariantFlags
sourceimpl Extend<VariantFlags> for VariantFlags
impl Extend<VariantFlags> for VariantFlags
sourcefn extend<T: IntoIterator<Item = VariantFlags>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = VariantFlags>>(&mut self, iterator: T)
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl FromIterator<VariantFlags> for VariantFlags
impl FromIterator<VariantFlags> for VariantFlags
sourcefn from_iter<T: IntoIterator<Item = VariantFlags>>(iterator: T) -> VariantFlags
fn from_iter<T: IntoIterator<Item = VariantFlags>>(iterator: T) -> VariantFlags
Creates a value from an iterator. Read more
sourceimpl Hash for VariantFlags
impl Hash for VariantFlags
sourceimpl<'__ctx> HashStable<StableHashingContext<'__ctx>> for VariantFlags
impl<'__ctx> HashStable<StableHashingContext<'__ctx>> for VariantFlags
fn hash_stable(
&self,
__hcx: &mut StableHashingContext<'__ctx>,
__hasher: &mut StableHasher
)
sourceimpl LowerHex for VariantFlags
impl LowerHex for VariantFlags
sourceimpl Not for VariantFlags
impl Not for VariantFlags
sourcefn not(self) -> VariantFlags
fn not(self) -> VariantFlags
Returns the complement of this set of flags.
type Output = VariantFlags
type Output = VariantFlags
The resulting type after applying the !
operator.
sourceimpl Octal for VariantFlags
impl Octal for VariantFlags
sourceimpl Ord for VariantFlags
impl Ord for VariantFlags
sourceimpl PartialEq<VariantFlags> for VariantFlags
impl PartialEq<VariantFlags> for VariantFlags
sourcefn eq(&self, other: &VariantFlags) -> bool
fn eq(&self, other: &VariantFlags) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &VariantFlags) -> bool
fn ne(&self, other: &VariantFlags) -> bool
This method tests for !=
.
sourceimpl PartialOrd<VariantFlags> for VariantFlags
impl PartialOrd<VariantFlags> for VariantFlags
sourcefn partial_cmp(&self, other: &VariantFlags) -> Option<Ordering>
fn partial_cmp(&self, other: &VariantFlags) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl Sub<VariantFlags> for VariantFlags
impl Sub<VariantFlags> for VariantFlags
sourcefn sub(self, other: VariantFlags) -> VariantFlags
fn sub(self, other: VariantFlags) -> VariantFlags
Returns the set difference of the two sets of flags.
type Output = VariantFlags
type Output = VariantFlags
The resulting type after applying the -
operator.
sourceimpl SubAssign<VariantFlags> for VariantFlags
impl SubAssign<VariantFlags> for VariantFlags
sourcefn sub_assign(&mut self, other: VariantFlags)
fn sub_assign(&mut self, other: VariantFlags)
Disables all flags enabled in the set.
sourceimpl UpperHex for VariantFlags
impl UpperHex for VariantFlags
impl Copy for VariantFlags
impl Eq for VariantFlags
impl StructuralEq for VariantFlags
impl StructuralPartialEq for VariantFlags
Auto Trait Implementations
impl RefUnwindSafe for VariantFlags
impl Send for VariantFlags
impl Sync for VariantFlags
impl Unpin for VariantFlags
impl UnwindSafe for VariantFlags
Blanket Implementations
sourceimpl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for T where
T: Copy,
impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for T where
T: Copy,
fn allocate_on(self, arena: &'a Arena<'tcx>) -> &'a mut T
fn allocate_from_iter(
arena: &'a Arena<'tcx>,
iter: impl IntoIterator<Item = T>
) -> &'a mut [T]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Ctxt, T> DepNodeParams<Ctxt> for T where
Ctxt: DepContext,
T: for<'a> HashStable<StableHashingContext<'a>> + Debug,
impl<Ctxt, T> DepNodeParams<Ctxt> for T where
Ctxt: DepContext,
T: for<'a> HashStable<StableHashingContext<'a>> + Debug,
default fn fingerprint_style() -> FingerprintStyle
sourcedefault fn to_fingerprint(&self, tcx: Ctxt) -> Fingerprint
default fn to_fingerprint(&self, tcx: Ctxt) -> Fingerprint
This method turns the parameters of a DepNodeConstructor into an opaque Fingerprint to be used in DepNode. Not all DepNodeParams support being turned into a Fingerprint (they don’t need to if the corresponding DepNode is anonymous). Read more
default fn to_debug_str(&self, Ctxt) -> String
sourcedefault fn recover(Ctxt, &DepNode<<Ctxt as DepContext>::DepKind>) -> Option<T>
default fn recover(Ctxt, &DepNode<<Ctxt as DepContext>::DepKind>) -> Option<T>
This method tries to recover the query key from the given 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. Read more
sourceimpl<T> MaybeResult<T> for T
impl<T> MaybeResult<T> for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<'a, T> Captures<'a> for T where
T: ?Sized,
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: 4 bytes