pub(crate) trait DepNodeParams<Tcx>: Sized + Debugwhere
Tcx: DepContext,{
// Required methods
fn fingerprint_style() -> FingerprintStyle;
fn to_debug_str(&self, tcx: Tcx) -> String;
fn recover(tcx: Tcx, dep_node: &DepNode) -> Option<Self>;
// Provided method
fn to_fingerprint(&self, _: Tcx) -> Fingerprint { ... }
}
Required Methods§
fn fingerprint_style() -> FingerprintStyle
fn to_debug_str(&self, tcx: Tcx) -> String
Sourcefn recover(tcx: Tcx, dep_node: &DepNode) -> Option<Self>
fn recover(tcx: Tcx, dep_node: &DepNode) -> Option<Self>
This method tries to recover the query key from the given DepNode
,
something which is needed when forcing DepNode
s 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.
Provided Methods§
Sourcefn to_fingerprint(&self, _: Tcx) -> Fingerprint
fn to_fingerprint(&self, _: Tcx) -> Fingerprint
This method turns the parameters of a DepNodeConstructor into an opaque Fingerprint to be used in DepNode. Not all DepNodeParams support being turned into a Fingerprint (they don’t need to if the corresponding DepNode is anonymous).
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.