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

pub struct DepGraph<K: DepKind> {
    data: Option<Lrc<DepGraphData<K>>>,
    virtual_dep_node_index: Lrc<AtomicU32>,
}

Fields

data: Option<Lrc<DepGraphData<K>>>virtual_dep_node_index: Lrc<AtomicU32>

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.

Implementations

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

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

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

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

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

Try to mark 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.

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

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

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Layout

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size: 16 bytes