[−][src]Trait rustc_middle::dep_graph::DepNodeExt

pub trait DepNodeExt: Sized {
    pub fn from_def_path_hash(def_path_hash: DefPathHash, kind: DepKind) -> Self;
pub fn extract_def_id(&self, tcx: TyCtxt<'_>) -> Option<DefId>;
pub fn from_label_string(
        label: &str,
        def_path_hash: DefPathHash
    ) -> Result<Self, ()>;
pub fn has_label_string(label: &str) -> bool; }

Required methods

pub fn from_def_path_hash(def_path_hash: DefPathHash, kind: DepKind) -> Self[src]

Construct a DepNode from the given DepKind and DefPathHash. This method will assert that the given DepKind actually requires a single DefId/DefPathHash parameter.

pub fn extract_def_id(&self, tcx: TyCtxt<'_>) -> Option<DefId>[src]

Extracts the DefId corresponding to this DepNode. This will work if two conditions are met:

  1. The Fingerprint of the DepNode actually is a DefPathHash, and
  2. the item that the DefPath refers to exists in the current tcx.

Condition (1) is determined by the DepKind variant of the DepNode. Condition (2) might not be fulfilled if a DepNode refers to something from the previous compilation session that has been removed.

pub fn from_label_string(
    label: &str,
    def_path_hash: DefPathHash
) -> Result<Self, ()>
[src]

Used in testing

pub fn has_label_string(label: &str) -> bool[src]

Used in testing

Loading content...

Implementors

impl DepNodeExt for DepNode[src]

pub fn from_def_path_hash(def_path_hash: DefPathHash, kind: DepKind) -> DepNode[src]

Construct a DepNode from the given DepKind and DefPathHash. This method will assert that the given DepKind actually requires a single DefId/DefPathHash parameter.

pub fn extract_def_id<'tcx>(&self, tcx: TyCtxt<'tcx>) -> Option<DefId>[src]

Extracts the DefId corresponding to this DepNode. This will work if two conditions are met:

  1. The Fingerprint of the DepNode actually is a DefPathHash, and
  2. the item that the DefPath refers to exists in the current tcx.

Condition (1) is determined by the DepKind variant of the DepNode. Condition (2) might not be fulfilled if a DepNode refers to something from the previous compilation session that has been removed.

pub fn from_label_string(
    label: &str,
    def_path_hash: DefPathHash
) -> Result<DepNode, ()>
[src]

Used in testing

pub fn has_label_string(label: &str) -> bool[src]

Used in testing

Loading content...