pub trait DepNodeKey<'tcx>: Debug + Sized {
// Required methods
fn key_fingerprint_style() -> KeyFingerprintStyle;
fn to_fingerprint(&self, tcx: TyCtxt<'tcx>) -> Fingerprint;
fn to_debug_str(&self, tcx: TyCtxt<'tcx>) -> String;
fn try_recover_key(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self>;
}Expand description
Trait for query keys as seen by dependency-node tracking.
Required Methods§
fn key_fingerprint_style() -> KeyFingerprintStyle
Sourcefn to_fingerprint(&self, tcx: TyCtxt<'tcx>) -> Fingerprint
fn to_fingerprint(&self, tcx: TyCtxt<'tcx>) -> Fingerprint
This method turns a query key into an opaque Fingerprint to be used
in DepNode.
fn to_debug_str(&self, tcx: TyCtxt<'tcx>) -> String
Sourcefn try_recover_key(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self>
fn try_recover_key(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self>
This method tries to recover the query key from the given DepNode,
something which is needed when forcing DepNodes during red-green
evaluation. The query system will only call this method if
fingerprint_style() is not FingerprintStyle::Opaque.
It is always valid to return None here, in which case incremental
compilation will treat the query as having changed instead of forcing it.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.