[][src]Trait rustc_middle::ty::query::keys::Key

pub trait Key {
    type CacheSelector;
    fn query_crate(&self) -> CrateNum;
fn default_span(&self, tcx: TyCtxt<'_>) -> Span; }

The Key trait controls what types can legally be used as the key for a query.

Associated Types

type CacheSelector

Loading content...

Required methods

fn query_crate(&self) -> CrateNum

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

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?

Loading content...

Implementations on Foreign Types

impl Key for CrateNum[src]

type CacheSelector = DefaultCacheSelector

impl Key for LocalDefId[src]

type CacheSelector = DefaultCacheSelector

impl Key for DefId[src]

type CacheSelector = DefaultCacheSelector

impl Key for (DefId, DefId)[src]

type CacheSelector = DefaultCacheSelector

impl Key for (DefId, LocalDefId)[src]

type CacheSelector = DefaultCacheSelector

impl Key for (LocalDefId, DefId)[src]

type CacheSelector = DefaultCacheSelector

impl Key for (CrateNum, DefId)[src]

type CacheSelector = DefaultCacheSelector

impl Key for (DefId, SimplifiedType)[src]

type CacheSelector = DefaultCacheSelector

impl<'tcx> Key for (DefId, SubstsRef<'tcx>)[src]

type CacheSelector = DefaultCacheSelector

impl<'tcx> Key for (LocalDefId, DefId, SubstsRef<'tcx>)[src]

type CacheSelector = DefaultCacheSelector

impl<'tcx> Key for (ParamEnv<'tcx>, PolyTraitRef<'tcx>)[src]

type CacheSelector = DefaultCacheSelector

impl<'tcx> Key for (&'tcx Const<'tcx>, Field)[src]

type CacheSelector = DefaultCacheSelector

impl Key for Symbol[src]

type CacheSelector = DefaultCacheSelector

impl Key for (Symbol, u32, u32)[src]

type CacheSelector = DefaultCacheSelector

impl<'tcx> Key for (DefId, Ty<'tcx>, SubstsRef<'tcx>, ParamEnv<'tcx>)[src]

type CacheSelector = DefaultCacheSelector

Loading content...

Implementors

impl Key for WithOptConstParam<LocalDefId>[src]

impl<'tcx> Key for &'tcx Const<'tcx>[src]

impl<'tcx> Key for &'tcx List<Predicate<'tcx>>[src]

impl<'tcx> Key for InstanceDef<'tcx>[src]

impl<'tcx> Key for GlobalId<'tcx>[src]

impl<'tcx> Key for LitToConstInput<'tcx>[src]

impl<'tcx> Key for Instance<'tcx>[src]

impl<'tcx> Key for ParamEnv<'tcx>[src]

impl<'tcx> Key for GenericArg<'tcx>[src]

impl<'tcx> Key for PolyTraitRef<'tcx>[src]

impl<'tcx> Key for SubstsRef<'tcx>[src]

impl<'tcx> Key for Ty<'tcx>[src]

impl<'tcx, T> Key for Canonical<'tcx, T>[src]

Canonical query goals correspond to abstract trait operations that are not tied to any crate in particular.

impl<'tcx, T: Key> Key for ParamEnvAnd<'tcx, T>[src]

Loading content...