rustc_middle::dep_graph::dep_node

Trait DepNodeParams

pub(crate) trait DepNodeParams<Tcx>: Sized + Debug
where Tcx: DepContext,
{ // Required methods fn fingerprint_style() -> FingerprintStyle; fn recover(tcx: Tcx, dep_node: &DepNode) -> Option<Self>; // Provided methods fn to_fingerprint(&self, _: Tcx) -> Fingerprint { ... } fn to_debug_str(&self, _: Tcx) -> String { ... } }

Required Methods§

fn fingerprint_style() -> FingerprintStyle

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 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.

Provided Methods§

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).

fn to_debug_str(&self, _: Tcx) -> String

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.

Implementations on Foreign Types§

Source§

impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for (DefId, DefId)

Source§

fn fingerprint_style() -> FingerprintStyle

Source§

fn to_fingerprint(&self, tcx: TyCtxt<'tcx>) -> Fingerprint

Source§

fn to_debug_str(&self, tcx: TyCtxt<'tcx>) -> String

Source§

impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for ()

Source§

fn fingerprint_style() -> FingerprintStyle

Source§

fn to_fingerprint(&self, _: TyCtxt<'tcx>) -> Fingerprint

Source§

fn recover(_: TyCtxt<'tcx>, _: &DepNode) -> Option<Self>

Source§

impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for CrateNum

Source§

fn fingerprint_style() -> FingerprintStyle

Source§

fn to_fingerprint(&self, tcx: TyCtxt<'tcx>) -> Fingerprint

Source§

fn to_debug_str(&self, tcx: TyCtxt<'tcx>) -> String

Source§

fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self>

Source§

impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for DefId

Source§

fn fingerprint_style() -> FingerprintStyle

Source§

fn to_fingerprint(&self, tcx: TyCtxt<'tcx>) -> Fingerprint

Source§

fn to_debug_str(&self, tcx: TyCtxt<'tcx>) -> String

Source§

fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self>

Source§

impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for LocalDefId

Source§

fn fingerprint_style() -> FingerprintStyle

Source§

fn to_fingerprint(&self, tcx: TyCtxt<'tcx>) -> Fingerprint

Source§

fn to_debug_str(&self, tcx: TyCtxt<'tcx>) -> String

Source§

fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self>

Source§

impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for LocalModDefId

Source§

fn fingerprint_style() -> FingerprintStyle

Source§

fn to_fingerprint(&self, tcx: TyCtxt<'tcx>) -> Fingerprint

Source§

fn to_debug_str(&self, tcx: TyCtxt<'tcx>) -> String

Source§

fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self>

Source§

impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for ModDefId

Source§

fn fingerprint_style() -> FingerprintStyle

Source§

fn to_fingerprint(&self, tcx: TyCtxt<'tcx>) -> Fingerprint

Source§

fn to_debug_str(&self, tcx: TyCtxt<'tcx>) -> String

Source§

fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self>

Source§

impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for HirId

Source§

fn fingerprint_style() -> FingerprintStyle

Source§

fn to_fingerprint(&self, tcx: TyCtxt<'tcx>) -> Fingerprint

Source§

fn to_debug_str(&self, tcx: TyCtxt<'tcx>) -> String

Source§

fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self>

Source§

impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for OwnerId

Source§

fn fingerprint_style() -> FingerprintStyle

Source§

fn to_fingerprint(&self, tcx: TyCtxt<'tcx>) -> Fingerprint

Source§

fn to_debug_str(&self, tcx: TyCtxt<'tcx>) -> String

Source§

fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self>

Implementors§

§

impl<Tcx, T> DepNodeParams<Tcx> for T
where Tcx: DepContext, T: for<'a> HashStable<StableHashingContext<'a>> + Debug,