[][src]Struct rustc::dep_graph::graph::DepGraph

pub struct DepGraph {
    data: Option<Lrc<DepGraphData>>,
    virtual_dep_node_index: Lrc<AtomicU32>,
}
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Fields

data: Option<Lrc<DepGraphData>>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

virtual_dep_node_index: Lrc<AtomicU32>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

This field is used for assigning DepNodeIndices when running in non-incremental mode. Even in non-incremental mode we make sure that each task has a DepNodeIndex that uniquely identifies it. This unique ID is used for self-profiling.

Methods

impl DepGraph[src]

pub fn new(
    prev_graph: PreviousDepGraph,
    prev_work_products: FxHashMap<WorkProductId, WorkProduct>
) -> DepGraph
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn new_disabled() -> DepGraph[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn is_fully_enabled(&self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Returns true if we are actually building the full dep-graph, and false otherwise.

pub fn query(&self) -> DepGraphQuery[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn assert_ignored(&self)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn with_ignore<OP, R>(&self, op: OP) -> R where
    OP: FnOnce() -> R, 
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn with_task<'a, C, A, R>(
    &self,
    key: DepNode,
    cx: C,
    arg: A,
    task: fn(_: C, _: A) -> R,
    hash_result: impl FnOnce(&mut StableHashingContext, &R) -> Option<Fingerprint>
) -> (R, DepNodeIndex) where
    C: DepGraphSafe + StableHashingContextProvider<'a>, 
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Starts a new dep-graph task. Dep-graph tasks are specified using a free function (task) and not a closure -- this is intentional because we want to exercise tight control over what state they have access to. In particular, we want to prevent implicit 'leaks' of tracked state into the task (which could then be read without generating correct edges in the dep-graph -- see the rustc guide for more details on the dep-graph). To this end, the task function gets exactly two pieces of state: the context cx and an argument arg. Both of these bits of state must be of some type that implements DepGraphSafe and hence does not leak.

The choice of two arguments is not fundamental. One argument would work just as well, since multiple values can be collected using tuples. However, using two arguments works out to be quite convenient, since it is common to need a context (cx) and some argument (e.g., a DefId identifying what item to process).

For cases where you need some other number of arguments:

  • If you only need one argument, just use () for the arg parameter.
  • If you need 3+ arguments, use a tuple for the arg parameter.

pub fn input_task<'a, C, R>(
    &self,
    key: DepNode,
    cx: C,
    input: R
) -> (R, DepNodeIndex) where
    C: DepGraphSafe + StableHashingContextProvider<'a>,
    R: for<'b> HashStable<StableHashingContext<'b>>, 
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Creates a new dep-graph input with value input

fn with_task_impl<'a, C, A, R>(
    &self,
    key: DepNode,
    cx: C,
    arg: A,
    no_tcx: bool,
    task: fn(_: C, _: A) -> R,
    create_task: fn(_: DepNode) -> Option<TaskDeps>,
    finish_task_and_alloc_depnode: fn(_: &CurrentDepGraph, _: DepNode, _: Fingerprint, _: Option<TaskDeps>) -> DepNodeIndex,
    hash_result: impl FnOnce(&mut StableHashingContext, &R) -> Option<Fingerprint>
) -> (R, DepNodeIndex) where
    C: DepGraphSafe + StableHashingContextProvider<'a>, 
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn with_anon_task<OP, R>(
    &self,
    dep_kind: DepKind,
    op: OP
) -> (R, DepNodeIndex) where
    OP: FnOnce() -> R, 
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Executes something within an "anonymous" task, that is, a task the DepNode of which is determined by the list of inputs it read from.

pub fn with_eval_always_task<'a, C, A, R>(
    &self,
    key: DepNode,
    cx: C,
    arg: A,
    task: fn(_: C, _: A) -> R,
    hash_result: impl FnOnce(&mut StableHashingContext, &R) -> Option<Fingerprint>
) -> (R, DepNodeIndex) where
    C: DepGraphSafe + StableHashingContextProvider<'a>, 
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Executes something within an "eval-always" task which is a task that runs whenever anything changes.

pub fn read(&self, v: DepNode)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn read_index(&self, dep_node_index: DepNodeIndex)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn dep_node_index_of(&self, dep_node: &DepNode) -> DepNodeIndex[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn dep_node_exists(&self, dep_node: &DepNode) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn fingerprint_of(&self, dep_node_index: DepNodeIndex) -> Fingerprint[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn prev_fingerprint_of(&self, dep_node: &DepNode) -> Option<Fingerprint>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn prev_dep_node_index_of(
    &self,
    dep_node: &DepNode
) -> SerializedDepNodeIndex
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn previous_work_product(&self, v: &WorkProductId) -> Option<WorkProduct>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Checks whether a previous work product exists for v and, if so, return the path that leads to it. Used to skip doing work.

pub fn previous_work_products(&self) -> &FxHashMap<WorkProductId, WorkProduct>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Access the map of work-products created during the cached run. Only used during saving of the dep-graph.

pub fn register_dep_node_debug_str<F>(
    &self,
    dep_node: DepNode,
    debug_str_gen: F
) where
    F: FnOnce() -> String
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn dep_node_debug_str(
    &self,
    dep_node: DepNode
) -> Option<String>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn edge_deduplication_data(&self) -> Option<(u64, u64)>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn serialize(&self) -> SerializedDepGraph[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn node_color(&self, dep_node: &DepNode) -> Option<DepNodeColor>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn try_mark_green_and_read(
    &self,
    tcx: TyCtxt,
    dep_node: &DepNode
) -> Option<(SerializedDepNodeIndex, DepNodeIndex)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Try to read a node index for the node dep_node. A node will have an index, when it's already been marked green, or when we can mark it green. This function will mark the current task as a reader of the specified node, when a node index can be found for that node.

pub fn try_mark_green(
    &self,
    tcx: TyCtxt,
    dep_node: &DepNode
) -> Option<(SerializedDepNodeIndex, DepNodeIndex)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn try_mark_previous_green<'tcx>(
    &self,
    tcx: TyCtxt<'tcx>,
    data: &DepGraphData,
    prev_dep_node_index: SerializedDepNodeIndex,
    dep_node: &DepNode
) -> Option<DepNodeIndex>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Try to mark a dep-node which existed in the previous compilation session as green.

fn emit_diagnostics<'tcx>(
    &self,
    tcx: TyCtxt<'tcx>,
    data: &DepGraphData,
    dep_node_index: DepNodeIndex,
    prev_dep_node_index: SerializedDepNodeIndex,
    diagnostics: Vec<Diagnostic>
)
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Atomically emits some loaded diagnostics. This may be called concurrently on multiple threads for the same dep node.

pub fn is_green(&self, dep_node: &DepNode) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn exec_cache_promotions(&self, tcx: TyCtxt)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn next_virtual_depnode_index(&self) -> DepNodeIndex[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Trait Implementations

impl Clone for DepGraph[src]

Auto Trait Implementations

impl !RefUnwindSafe for DepGraph

impl !Send for DepGraph

impl !Sync for DepGraph

impl Unpin for DepGraph

impl !UnwindSafe for DepGraph

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T> Captures<'a> for T where
    T: ?Sized
[src]

impl<T> Erased for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> MaybeResult<T> for T[src]

type Error = !

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<E> SpecializationError for E[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> WithConstness for T[src]