Trait rustc_query_impl::keys::Key [−][src]
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
fn 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.
fn 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
fn 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
Canonical query goals correspond to abstract trait operations that are not tied to any crate in particular.