pub(super) enum UniqueTypeId<'tcx> {
    Ty(Ty<'tcx>, HiddenZst),
    VariantPart(Ty<'tcx>, HiddenZst),
    VariantStructType(Ty<'tcx>, VariantIdx, HiddenZst),
    VariantStructTypeCppLikeWrapper(Ty<'tcx>, VariantIdx, HiddenZst),
    VTableTy(Ty<'tcx>, Option<PolyExistentialTraitRef<'tcx>>, HiddenZst),
}
Expand description

A unique identifier for anything that we create a debuginfo node for. The types it contains are expected to already be normalized (which is debug_asserted in the constructors).

Note that there are some things that only show up in debuginfo, like the separate type descriptions for each enum variant. These get an ID too because they have their own debuginfo node in LLVM IR.

Variants§

§

Ty(Ty<'tcx>, HiddenZst)

The ID of a regular type as it shows up at the language level.

§

VariantPart(Ty<'tcx>, HiddenZst)

The ID for the single DW_TAG_variant_part nested inside the top-level DW_TAG_structure_type that describes enums and coroutines.

§

VariantStructType(Ty<'tcx>, VariantIdx, HiddenZst)

The ID for the artificial struct type describing a single enum variant.

§

VariantStructTypeCppLikeWrapper(Ty<'tcx>, VariantIdx, HiddenZst)

The ID for the additional wrapper struct type describing an enum variant in CPP-like mode.

§

VTableTy(Ty<'tcx>, Option<PolyExistentialTraitRef<'tcx>>, HiddenZst)

The ID of the artificial type we create for VTables.

Implementations§

source§

impl<'tcx> UniqueTypeId<'tcx>

source

pub fn for_ty(tcx: TyCtxt<'tcx>, t: Ty<'tcx>) -> Self

source

pub fn for_enum_variant_part(tcx: TyCtxt<'tcx>, enum_ty: Ty<'tcx>) -> Self

source

pub fn for_enum_variant_struct_type( tcx: TyCtxt<'tcx>, enum_ty: Ty<'tcx>, variant_idx: VariantIdx ) -> Self

source

pub fn for_enum_variant_struct_type_wrapper( tcx: TyCtxt<'tcx>, enum_ty: Ty<'tcx>, variant_idx: VariantIdx ) -> Self

source

pub fn for_vtable_ty( tcx: TyCtxt<'tcx>, self_type: Ty<'tcx>, implemented_trait: Option<PolyExistentialTraitRef<'tcx>> ) -> Self

source

pub fn generate_unique_id_string(self, tcx: TyCtxt<'tcx>) -> String

Generates a string version of this UniqueTypeId, which can be used as the UniqueId argument of the various LLVMRustDIBuilderCreate*Type() methods.

Right now this takes the form of a hex-encoded opaque hash value.

source

pub fn expect_ty(self) -> Ty<'tcx>

Trait Implementations§

source§

impl<'tcx> Clone for UniqueTypeId<'tcx>

source§

fn clone(&self) -> UniqueTypeId<'tcx>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'tcx> Debug for UniqueTypeId<'tcx>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'tcx> Hash for UniqueTypeId<'tcx>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<'tcx, '__ctx> HashStable<StableHashingContext<'__ctx>> for UniqueTypeId<'tcx>

source§

fn hash_stable( &self, __hcx: &mut StableHashingContext<'__ctx>, __hasher: &mut StableHasher )

source§

impl<'tcx> PartialEq for UniqueTypeId<'tcx>

source§

fn eq(&self, other: &UniqueTypeId<'tcx>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'tcx> Copy for UniqueTypeId<'tcx>

source§

impl<'tcx> Eq for UniqueTypeId<'tcx>

source§

impl<'tcx> StructuralEq for UniqueTypeId<'tcx>

source§

impl<'tcx> StructuralPartialEq for UniqueTypeId<'tcx>

Auto Trait Implementations§

§

impl<'tcx> !RefUnwindSafe for UniqueTypeId<'tcx>

§

impl<'tcx> Send for UniqueTypeId<'tcx>

§

impl<'tcx> Sync for UniqueTypeId<'tcx>

§

impl<'tcx> Unpin for UniqueTypeId<'tcx>

§

impl<'tcx> !UnwindSafe for UniqueTypeId<'tcx>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.

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

Size for each variant:

  • Ty: 16 bytes
  • VariantPart: 16 bytes
  • VariantStructType: 24 bytes
  • VariantStructTypeCppLikeWrapper: 24 bytes
  • VTableTy: 32 bytes