Skip to main content

AliasTyKind

Type Alias AliasTyKind 

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

Aliased Type§

pub enum AliasTyKind<'tcx> {
    Projection {
        def_id: DefId,
    },
    Inherent {
        def_id: DefId,
    },
    Opaque {
        def_id: DefId,
    },
    Free {
        def_id: DefId,
    },
}

Variants§

§

Projection

A projection <Type as Trait>::AssocType.

Can get normalized away if monomorphic enough.

The def_id is the DefId of the TraitItem for the associated type.

Note that the def_id 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).

Fields

§def_id: DefId
§

Inherent

An associated type in an inherent impl

The def_id is the DefId of the ImplItem for the associated type.

Fields

§def_id: DefId
§

Opaque

An opaque type (usually from impl Trait in type aliases or function return types)

def_id is the DefId of the OpaqueType item.

Can only be normalized away in PostAnalysis mode or its defining scope.

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

Fields

§def_id: DefId
§

Free

A type alias that actually checks its trait bounds.

Currently only used if the type alias references opaque types. Can always be normalized away.

Fields

§def_id: DefId

Trait Implementations§

Source§

impl<'tcx> QueryKey for AliasTyKind<'tcx>

Source§

fn default_span(&self, tcx: TyCtxt<'_>) -> Span

In the event that a cycle occurs, if no explicit span has been given for a query with key self, what span should we use?
Source§

type Cache<V> = DefaultCache<Self, V>

The type of in-memory cache to use for queries with this key type. Read more
Source§

type LocalQueryKey = !

Source§

fn key_as_def_id(&self) -> Option<DefId>

If the key is a DefId or DefId–equivalent, return that DefId. Otherwise, return None.
Source§

fn as_local_key(&self) -> Option<Self::LocalQueryKey>

Given an instance of this key, what crate is it referring to? This is used to find the provider.

Layout§

Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.