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>
impl<'tcx> UniqueTypeId<'tcx>
pub fn for_ty(tcx: TyCtxt<'tcx>, t: Ty<'tcx>) -> Self
pub fn for_enum_variant_part(tcx: TyCtxt<'tcx>, enum_ty: Ty<'tcx>) -> Self
pub fn for_enum_variant_struct_type( tcx: TyCtxt<'tcx>, enum_ty: Ty<'tcx>, variant_idx: VariantIdx ) -> Self
pub fn for_enum_variant_struct_type_wrapper( tcx: TyCtxt<'tcx>, enum_ty: Ty<'tcx>, variant_idx: VariantIdx ) -> Self
pub fn for_vtable_ty( tcx: TyCtxt<'tcx>, self_type: Ty<'tcx>, implemented_trait: Option<PolyExistentialTraitRef<'tcx>> ) -> Self
sourcepub fn generate_unique_id_string(self, tcx: TyCtxt<'tcx>) -> String
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.
pub fn expect_ty(self) -> Ty<'tcx>
Trait Implementations§
source§impl<'tcx> Clone for UniqueTypeId<'tcx>
impl<'tcx> Clone for UniqueTypeId<'tcx>
source§fn clone(&self) -> UniqueTypeId<'tcx>
fn clone(&self) -> UniqueTypeId<'tcx>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'tcx> Debug for UniqueTypeId<'tcx>
impl<'tcx> Debug for UniqueTypeId<'tcx>
source§impl<'tcx> Hash for UniqueTypeId<'tcx>
impl<'tcx> Hash for UniqueTypeId<'tcx>
source§impl<'tcx, '__ctx> HashStable<StableHashingContext<'__ctx>> for UniqueTypeId<'tcx>
impl<'tcx, '__ctx> HashStable<StableHashingContext<'__ctx>> for UniqueTypeId<'tcx>
fn hash_stable( &self, __hcx: &mut StableHashingContext<'__ctx>, __hasher: &mut StableHasher )
source§impl<'tcx> PartialEq for UniqueTypeId<'tcx>
impl<'tcx> PartialEq for UniqueTypeId<'tcx>
source§fn eq(&self, other: &UniqueTypeId<'tcx>) -> bool
fn eq(&self, other: &UniqueTypeId<'tcx>) -> bool
self
and other
values to be equal, and is used
by ==
.impl<'tcx> Copy for UniqueTypeId<'tcx>
impl<'tcx> Eq for UniqueTypeId<'tcx>
impl<'tcx> StructuralEq for UniqueTypeId<'tcx>
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> 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
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 bytesVariantPart
: 16 bytesVariantStructType
: 24 bytesVariantStructTypeCppLikeWrapper
: 24 bytesVTableTy
: 32 bytes