Struct rustc_type_ir::TypeFlags
source · [−]pub struct TypeFlags {
pub(crate) bits: u32,
}Expand description
Flags that we track on types. These flags are propagated upwards through the type during type construction, so that we can quickly check whether the type has various kinds of types in it without recursing over the type itself.
Fields
bits: u32Implementations
sourceimpl TypeFlags
impl TypeFlags
sourcepub const HAS_TY_PARAM: TypeFlags = _
pub const HAS_TY_PARAM: TypeFlags = _
Does this have Param?
sourcepub const HAS_RE_PARAM: TypeFlags = _
pub const HAS_RE_PARAM: TypeFlags = _
Does this have ReEarlyBound?
sourcepub const HAS_CT_PARAM: TypeFlags = _
pub const HAS_CT_PARAM: TypeFlags = _
Does this have ConstKind::Param?
pub const NEEDS_SUBST: TypeFlags = _
sourcepub const HAS_TY_INFER: TypeFlags = _
pub const HAS_TY_INFER: TypeFlags = _
Does this have Infer?
sourcepub const HAS_RE_INFER: TypeFlags = _
pub const HAS_RE_INFER: TypeFlags = _
Does this have ReVar?
sourcepub const HAS_CT_INFER: TypeFlags = _
pub const HAS_CT_INFER: TypeFlags = _
Does this have ConstKind::Infer?
sourcepub const NEEDS_INFER: TypeFlags = _
pub const NEEDS_INFER: TypeFlags = _
Does this have inference variables? Used to determine whether inference is required.
sourcepub const HAS_TY_PLACEHOLDER: TypeFlags = _
pub const HAS_TY_PLACEHOLDER: TypeFlags = _
Does this have Placeholder?
sourcepub const HAS_RE_PLACEHOLDER: TypeFlags = _
pub const HAS_RE_PLACEHOLDER: TypeFlags = _
Does this have RePlaceholder?
sourcepub const HAS_CT_PLACEHOLDER: TypeFlags = _
pub const HAS_CT_PLACEHOLDER: TypeFlags = _
Does this have ConstKind::Placeholder?
sourcepub const HAS_FREE_LOCAL_REGIONS: TypeFlags = _
pub const HAS_FREE_LOCAL_REGIONS: TypeFlags = _
true if there are “names” of regions and so forth
that are local to a particular fn/inferctxt
sourcepub const HAS_FREE_LOCAL_NAMES: TypeFlags = _
pub const HAS_FREE_LOCAL_NAMES: TypeFlags = _
true if there are “names” of types and regions and so forth
that are local to a particular fn
sourcepub const HAS_TY_PROJECTION: TypeFlags = _
pub const HAS_TY_PROJECTION: TypeFlags = _
Does this have Projection?
sourcepub const HAS_TY_OPAQUE: TypeFlags = _
pub const HAS_TY_OPAQUE: TypeFlags = _
Does this have Opaque?
sourcepub const HAS_CT_PROJECTION: TypeFlags = _
pub const HAS_CT_PROJECTION: TypeFlags = _
Does this have ConstKind::Unevaluated?
sourcepub const HAS_PROJECTION: TypeFlags = _
pub const HAS_PROJECTION: TypeFlags = _
Could this type be normalized further?
sourcepub const HAS_FREE_REGIONS: TypeFlags = _
pub const HAS_FREE_REGIONS: TypeFlags = _
Does this have any region that “appears free” in the type?
Basically anything but ReLateBound and ReErased.
sourcepub const HAS_RE_LATE_BOUND: TypeFlags = _
pub const HAS_RE_LATE_BOUND: TypeFlags = _
Does this have any ReLateBound regions? Used to check
if a global bound is safe to evaluate.
sourcepub const HAS_RE_ERASED: TypeFlags = _
pub const HAS_RE_ERASED: TypeFlags = _
Does this have any ReErased regions?
sourcepub const STILL_FURTHER_SPECIALIZABLE: TypeFlags = _
pub const STILL_FURTHER_SPECIALIZABLE: TypeFlags = _
Does this value have parameters/placeholders/inference variables which could be
replaced later, in a way that would change the results of impl specialization?
sourcepub const HAS_TY_FRESH: TypeFlags = _
pub const HAS_TY_FRESH: TypeFlags = _
Does this value have InferTy::FreshTy/FreshIntTy/FreshFloatTy?
sourcepub const HAS_CT_FRESH: TypeFlags = _
pub const HAS_CT_FRESH: TypeFlags = _
Does this value have InferConst::Fresh?
sourcepub fn from_bits(bits: u32) -> Option<TypeFlags>
pub fn from_bits(bits: u32) -> Option<TypeFlags>
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) -> TypeFlags
pub const fn from_bits_truncate(bits: u32) -> TypeFlags
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
sourcepub const unsafe fn from_bits_unchecked(bits: u32) -> TypeFlags
pub const unsafe fn from_bits_unchecked(bits: u32) -> TypeFlags
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
sourcepub const fn intersects(&self, other: TypeFlags) -> bool
pub const fn intersects(&self, other: TypeFlags) -> bool
Returns true if there are flags common to both self and other.
Trait Implementations
sourceimpl BitAndAssign<TypeFlags> for TypeFlags
impl BitAndAssign<TypeFlags> for TypeFlags
sourcefn bitand_assign(&mut self, other: TypeFlags)
fn bitand_assign(&mut self, other: TypeFlags)
Disables all flags disabled in the set.
sourceimpl BitOrAssign<TypeFlags> for TypeFlags
impl BitOrAssign<TypeFlags> for TypeFlags
sourcefn bitor_assign(&mut self, other: TypeFlags)
fn bitor_assign(&mut self, other: TypeFlags)
Adds the set of flags.
sourceimpl BitXorAssign<TypeFlags> for TypeFlags
impl BitXorAssign<TypeFlags> for TypeFlags
sourcefn bitxor_assign(&mut self, other: TypeFlags)
fn bitxor_assign(&mut self, other: TypeFlags)
Toggles the set of flags.
sourceimpl Extend<TypeFlags> for TypeFlags
impl Extend<TypeFlags> for TypeFlags
sourcefn extend<T: IntoIterator<Item = TypeFlags>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = TypeFlags>>(&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<TypeFlags> for TypeFlags
impl FromIterator<TypeFlags> for TypeFlags
sourceimpl Ord for TypeFlags
impl Ord for TypeFlags
sourceimpl PartialOrd<TypeFlags> for TypeFlags
impl PartialOrd<TypeFlags> for TypeFlags
sourcefn partial_cmp(&self, other: &TypeFlags) -> Option<Ordering>
fn partial_cmp(&self, other: &TypeFlags) -> 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 SubAssign<TypeFlags> for TypeFlags
impl SubAssign<TypeFlags> for TypeFlags
sourcefn sub_assign(&mut self, other: TypeFlags)
fn sub_assign(&mut self, other: TypeFlags)
Disables all flags enabled in the set.
impl Copy for TypeFlags
impl Eq for TypeFlags
impl StructuralEq for TypeFlags
impl StructuralPartialEq for TypeFlags
Auto Trait Implementations
impl RefUnwindSafe for TypeFlags
impl Send for TypeFlags
impl Sync for TypeFlags
impl Unpin for TypeFlags
impl UnwindSafe for TypeFlags
Blanket Implementations
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<T, R> InternIteratorElement<T, R> for T
impl<T, R> InternIteratorElement<T, R> for T
type Output = R
fn intern_with<I, F>(iter: I, f: F) -> <T as InternIteratorElement<T, R>>::Output where
I: Iterator<Item = T>,
F: FnOnce(&[T]) -> R,
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