Trait rustc_query_impl::keys::Key
source · pub trait Key {
fn query_crate_is_local(&self) -> bool;
fn default_span(&self, tcx: TyCtxt<'_>) -> Span;
fn key_as_def_id(&self) -> Option<DefId> { ... }
}
Expand description
The Key
trait controls what types can legally be used as the key
for a query.
Required Methods
sourcefn query_crate_is_local(&self) -> bool
fn query_crate_is_local(&self) -> bool
Given an instance of this key, what crate is it referring to? This is used to find the provider.
sourcefn default_span(&self, tcx: TyCtxt<'_>) -> Span
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?
Provided Methods
sourcefn key_as_def_id(&self) -> Option<DefId>
fn key_as_def_id(&self) -> Option<DefId>
If the key is a DefId
or DefId
–equivalent, return that DefId
.
Otherwise, return None
.
Implementations on Foreign Types
sourceimpl Key for ()
impl Key for ()
fn query_crate_is_local(&self) -> bool
fn default_span(&self, _: TyCtxt<'_>) -> Span
sourceimpl<'tcx> Key for InstanceDef<'tcx>
impl<'tcx> Key for InstanceDef<'tcx>
fn query_crate_is_local(&self) -> bool
fn default_span(&self, tcx: TyCtxt<'_>) -> Span
sourceimpl<'tcx> Key for Instance<'tcx>
impl<'tcx> Key for Instance<'tcx>
fn query_crate_is_local(&self) -> bool
fn default_span(&self, tcx: TyCtxt<'_>) -> Span
sourceimpl<'tcx> Key for GlobalId<'tcx>
impl<'tcx> Key for GlobalId<'tcx>
fn query_crate_is_local(&self) -> bool
fn default_span(&self, tcx: TyCtxt<'_>) -> Span
sourceimpl<'tcx> Key for (Ty<'tcx>, Option<PolyExistentialTraitRef<'tcx>>)
impl<'tcx> Key for (Ty<'tcx>, Option<PolyExistentialTraitRef<'tcx>>)
fn query_crate_is_local(&self) -> bool
fn default_span(&self, _: TyCtxt<'_>) -> Span
sourceimpl<'tcx> Key for LitToConstInput<'tcx>
impl<'tcx> Key for LitToConstInput<'tcx>
fn query_crate_is_local(&self) -> bool
fn default_span(&self, _tcx: TyCtxt<'_>) -> Span
sourceimpl Key for CrateNum
impl Key for CrateNum
fn query_crate_is_local(&self) -> bool
fn default_span(&self, _: TyCtxt<'_>) -> Span
sourceimpl Key for LocalDefId
impl Key for LocalDefId
fn query_crate_is_local(&self) -> bool
fn default_span(&self, tcx: TyCtxt<'_>) -> Span
fn key_as_def_id(&self) -> Option<DefId>
sourceimpl Key for DefId
impl Key for DefId
fn query_crate_is_local(&self) -> bool
fn default_span(&self, tcx: TyCtxt<'_>) -> Span
fn key_as_def_id(&self) -> Option<DefId>
sourceimpl Key for WithOptConstParam<LocalDefId>
impl Key for WithOptConstParam<LocalDefId>
fn query_crate_is_local(&self) -> bool
fn default_span(&self, tcx: TyCtxt<'_>) -> Span
sourceimpl Key for SimplifiedType
impl Key for SimplifiedType
fn query_crate_is_local(&self) -> bool
fn default_span(&self, _: TyCtxt<'_>) -> Span
sourceimpl Key for (DefId, DefId)
impl Key for (DefId, DefId)
fn query_crate_is_local(&self) -> bool
fn default_span(&self, tcx: TyCtxt<'_>) -> Span
sourceimpl<'tcx> Key for (Instance<'tcx>, LocalDefId)
impl<'tcx> Key for (Instance<'tcx>, LocalDefId)
fn query_crate_is_local(&self) -> bool
fn default_span(&self, tcx: TyCtxt<'_>) -> Span
sourceimpl Key for (DefId, LocalDefId)
impl Key for (DefId, LocalDefId)
fn query_crate_is_local(&self) -> bool
fn default_span(&self, tcx: TyCtxt<'_>) -> Span
sourceimpl Key for (LocalDefId, DefId)
impl Key for (LocalDefId, DefId)
fn query_crate_is_local(&self) -> bool
fn default_span(&self, tcx: TyCtxt<'_>) -> Span
sourceimpl Key for (LocalDefId, LocalDefId)
impl Key for (LocalDefId, LocalDefId)
fn query_crate_is_local(&self) -> bool
fn default_span(&self, tcx: TyCtxt<'_>) -> Span
sourceimpl Key for (DefId, Option<Ident>)
impl Key for (DefId, Option<Ident>)
fn query_crate_is_local(&self) -> bool
fn default_span(&self, tcx: TyCtxt<'_>) -> Span
fn key_as_def_id(&self) -> Option<DefId>
sourceimpl Key for (DefId, LocalDefId, Ident)
impl Key for (DefId, LocalDefId, Ident)
fn query_crate_is_local(&self) -> bool
fn default_span(&self, tcx: TyCtxt<'_>) -> Span
sourceimpl Key for (CrateNum, DefId)
impl Key for (CrateNum, DefId)
fn query_crate_is_local(&self) -> bool
fn default_span(&self, tcx: TyCtxt<'_>) -> Span
sourceimpl Key for (CrateNum, SimplifiedType)
impl Key for (CrateNum, SimplifiedType)
fn query_crate_is_local(&self) -> bool
fn default_span(&self, _: TyCtxt<'_>) -> Span
sourceimpl Key for (DefId, SimplifiedType)
impl Key for (DefId, SimplifiedType)
fn query_crate_is_local(&self) -> bool
fn default_span(&self, tcx: TyCtxt<'_>) -> Span
sourceimpl<'tcx> Key for SubstsRef<'tcx>
impl<'tcx> Key for SubstsRef<'tcx>
fn query_crate_is_local(&self) -> bool
fn default_span(&self, _: TyCtxt<'_>) -> Span
sourceimpl<'tcx> Key for (DefId, SubstsRef<'tcx>)
impl<'tcx> Key for (DefId, SubstsRef<'tcx>)
fn query_crate_is_local(&self) -> bool
fn default_span(&self, tcx: TyCtxt<'_>) -> Span
sourceimpl<'tcx> Key for (Unevaluated<'tcx, ()>, Unevaluated<'tcx, ()>)
impl<'tcx> Key for (Unevaluated<'tcx, ()>, Unevaluated<'tcx, ()>)
fn query_crate_is_local(&self) -> bool
fn default_span(&self, tcx: TyCtxt<'_>) -> Span
sourceimpl<'tcx> Key for (LocalDefId, DefId, SubstsRef<'tcx>)
impl<'tcx> Key for (LocalDefId, DefId, SubstsRef<'tcx>)
fn query_crate_is_local(&self) -> bool
fn default_span(&self, tcx: TyCtxt<'_>) -> Span
sourceimpl<'tcx> Key for (ParamEnv<'tcx>, PolyTraitRef<'tcx>)
impl<'tcx> Key for (ParamEnv<'tcx>, PolyTraitRef<'tcx>)
fn query_crate_is_local(&self) -> bool
fn default_span(&self, tcx: TyCtxt<'_>) -> Span
sourceimpl<'tcx> Key for (Const<'tcx>, Field)
impl<'tcx> Key for (Const<'tcx>, Field)
fn query_crate_is_local(&self) -> bool
fn default_span(&self, _: TyCtxt<'_>) -> Span
sourceimpl<'tcx> Key for ConstAlloc<'tcx>
impl<'tcx> Key for ConstAlloc<'tcx>
fn query_crate_is_local(&self) -> bool
fn default_span(&self, _: TyCtxt<'_>) -> Span
sourceimpl<'tcx> Key for PolyTraitRef<'tcx>
impl<'tcx> Key for PolyTraitRef<'tcx>
fn query_crate_is_local(&self) -> bool
fn default_span(&self, tcx: TyCtxt<'_>) -> Span
sourceimpl<'tcx> Key for PolyExistentialTraitRef<'tcx>
impl<'tcx> Key for PolyExistentialTraitRef<'tcx>
fn query_crate_is_local(&self) -> bool
fn default_span(&self, tcx: TyCtxt<'_>) -> Span
sourceimpl<'tcx> Key for (PolyTraitRef<'tcx>, PolyTraitRef<'tcx>)
impl<'tcx> Key for (PolyTraitRef<'tcx>, PolyTraitRef<'tcx>)
fn query_crate_is_local(&self) -> bool
fn default_span(&self, tcx: TyCtxt<'_>) -> Span
sourceimpl<'tcx> Key for GenericArg<'tcx>
impl<'tcx> Key for GenericArg<'tcx>
fn query_crate_is_local(&self) -> bool
fn default_span(&self, _: TyCtxt<'_>) -> Span
sourceimpl<'tcx> Key for ConstantKind<'tcx>
impl<'tcx> Key for ConstantKind<'tcx>
fn query_crate_is_local(&self) -> bool
fn default_span(&self, _: TyCtxt<'_>) -> Span
sourceimpl<'tcx> Key for Const<'tcx>
impl<'tcx> Key for Const<'tcx>
fn query_crate_is_local(&self) -> bool
fn default_span(&self, _: TyCtxt<'_>) -> Span
sourceimpl<'tcx> Key for Ty<'tcx>
impl<'tcx> Key for Ty<'tcx>
fn query_crate_is_local(&self) -> bool
fn default_span(&self, _: TyCtxt<'_>) -> Span
sourceimpl<'tcx> Key for TyAndLayout<'tcx>
impl<'tcx> Key for TyAndLayout<'tcx>
fn query_crate_is_local(&self) -> bool
fn default_span(&self, _: TyCtxt<'_>) -> Span
sourceimpl<'tcx> Key for (Ty<'tcx>, Ty<'tcx>)
impl<'tcx> Key for (Ty<'tcx>, Ty<'tcx>)
fn query_crate_is_local(&self) -> bool
fn default_span(&self, _: TyCtxt<'_>) -> Span
sourceimpl<'tcx> Key for &'tcx List<Predicate<'tcx>>
impl<'tcx> Key for &'tcx List<Predicate<'tcx>>
fn query_crate_is_local(&self) -> bool
fn default_span(&self, _: TyCtxt<'_>) -> Span
sourceimpl<'tcx> Key for ParamEnv<'tcx>
impl<'tcx> Key for ParamEnv<'tcx>
fn query_crate_is_local(&self) -> bool
fn default_span(&self, _: TyCtxt<'_>) -> Span
sourceimpl<'tcx, T: Key> Key for ParamEnvAnd<'tcx, T>
impl<'tcx, T: Key> Key for ParamEnvAnd<'tcx, T>
fn query_crate_is_local(&self) -> bool
fn default_span(&self, tcx: TyCtxt<'_>) -> Span
sourceimpl Key for Symbol
impl Key for Symbol
fn query_crate_is_local(&self) -> bool
fn default_span(&self, _tcx: TyCtxt<'_>) -> Span
sourceimpl Key for Option<Symbol>
impl Key for Option<Symbol>
fn query_crate_is_local(&self) -> bool
fn default_span(&self, _tcx: TyCtxt<'_>) -> Span
sourceimpl<'tcx, T> Key for Canonical<'tcx, T>
impl<'tcx, T> Key for Canonical<'tcx, T>
Canonical query goals correspond to abstract trait operations that are not tied to any crate in particular.