rustc_middle::ty

Type Alias AliasTerm

Source
pub type AliasTerm<'tcx> = AliasTerm<TyCtxt<'tcx>>;

Aliased Type§

struct AliasTerm<'tcx> {
    pub args: &'tcx RawList<(), GenericArg<'tcx>>,
    pub def_id: DefId,
    /* private fields */
}

Fields§

§args: &'tcx RawList<(), GenericArg<'tcx>>

The parameters of the associated or opaque item.

For a projection, these are the generic parameters for the trait and the GAT parameters, if there are any.

For an inherent projection, they consist of the self type and the GAT parameters, if there are any.

For RPIT the generic parameters are for the generics of the function, while for TAIT it is used for the generic parameters of the alias.

§def_id: DefId

The DefId of the TraitItem or ImplItem for the associated type N depending on whether this is a projection or an inherent projection or the DefId of the OpaqueType item if this is an opaque.

During codegen, interner.type_of(def_id) can be used to get the type of the underlying type if the type is an opaque.

Note that if this is an associated type, this is not the DefId of the TraitRef containing this associated type, which is in interner.associated_item(def_id).container, aka. interner.parent(def_id).

Trait Implementations§

Source§

impl<'tcx, P: PrettyPrinter<'tcx>> Print<'tcx, P> for AliasTerm<'tcx>

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: 16 bytes