Struct rustc_data_structures::obligation_forest::ObligationForest [−][src]
pub struct ObligationForest<O: ForestObligation> { nodes: Vec<Node<O>>, done_cache: FxHashSet<O::Predicate>, waiting_cache: FxHashMap<O::Predicate, NodeIndex>, scratch: Option<Vec<usize>>, }
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Fields
nodes: Vec<Node<O>>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
The list of obligations. In between calls to
process_obligations, this list only contains nodes in the
Pending or Success state (with a non-zero number of
incomplete children). During processing, some of those nodes
may be changed to the error state, or we may find that they
are completed (That is, num_incomplete_children drops to 0).
At the end of processing, those nodes will be removed by a
call to compress.
At all times we maintain the invariant that every node appears
at a higher index than its parent. This is needed by the
backtrace iterator (which uses split_at).
done_cache: FxHashSet<O::Predicate>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
A cache of predicates that have been successfully completed.
waiting_cache: FxHashMap<O::Predicate, NodeIndex>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
An cache of the nodes in nodes, indexed by predicate.
scratch: Option<Vec<usize>>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Methods
impl<O: ForestObligation> ObligationForest<O>[src]
impl<O: ForestObligation> ObligationForest<O>pub fn new() -> ObligationForest<O>[src]
pub fn new() -> ObligationForest<O>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
pub fn len(&self) -> usize[src]
pub fn len(&self) -> usize🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Return the total number of nodes in the forest that have not yet been fully resolved.
pub fn register_obligation(&mut self, obligation: O)[src]
pub fn register_obligation(&mut self, obligation: O)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Registers an obligation
This CAN be done in a snapshot
fn register_obligation_at(
&mut self,
obligation: O,
parent: Option<NodeIndex>
) -> Result<(), ()>[src]
fn register_obligation_at(
&mut self,
obligation: O,
parent: Option<NodeIndex>
) -> Result<(), ()>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
pub fn to_errors<E: Clone>(&mut self, error: E) -> Vec<Error<O, E>>[src]
pub fn to_errors<E: Clone>(&mut self, error: E) -> Vec<Error<O, E>>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Convert all remaining obligations to the given error.
This cannot be done during a snapshot.
pub fn map_pending_obligations<P, F>(&self, f: F) -> Vec<P> where
F: Fn(&O) -> P, [src]
pub fn map_pending_obligations<P, F>(&self, f: F) -> Vec<P> where
F: Fn(&O) -> P, 🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Returns the set of obligations that are in a pending state.
pub fn process_obligations<P>(
&mut self,
processor: &mut P
) -> Outcome<O, P::Error> where
P: ObligationProcessor<Obligation = O>, [src]
pub fn process_obligations<P>(
&mut self,
processor: &mut P
) -> Outcome<O, P::Error> where
P: ObligationProcessor<Obligation = O>, 🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Perform a pass through the obligation list. This must
be called in a loop until outcome.stalled is false.
This CANNOT be unrolled (presently, at least).
fn process_cycles<P>(&mut self, processor: &mut P) where
P: ObligationProcessor<Obligation = O>, [src]
fn process_cycles<P>(&mut self, processor: &mut P) where
P: ObligationProcessor<Obligation = O>, 🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Mark all NodeState::Success nodes as NodeState::Done and
report all cycles between them. This should be called
after mark_as_waiting marks all nodes with pending
subobligations as NodeState::Waiting.
fn find_cycles_from_node<P>(
&self,
stack: &mut Vec<usize>,
processor: &mut P,
index: usize
) where
P: ObligationProcessor<Obligation = O>, [src]
fn find_cycles_from_node<P>(
&self,
stack: &mut Vec<usize>,
processor: &mut P,
index: usize
) where
P: ObligationProcessor<Obligation = O>, 🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn error_at(&mut self, p: usize) -> Vec<O>[src]
fn error_at(&mut self, p: usize) -> Vec<O>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Returns a vector of obligations for p and all of its
ancestors, putting them into the error state in the process.
fn mark_neighbors_as_waiting_from(&self, node: &Node<O>)[src]
fn mark_neighbors_as_waiting_from(&self, node: &Node<O>)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn mark_as_waiting(&self)[src]
fn mark_as_waiting(&self)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Marks all nodes that depend on a pending node as NodeState::Waiting.
fn mark_as_waiting_from(&self, node: &Node<O>)[src]
fn mark_as_waiting_from(&self, node: &Node<O>)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn compress(&mut self) -> Vec<O>[src]
fn compress(&mut self) -> Vec<O>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Compresses the vector, removing all popped nodes. This adjusts the indices and hence invalidates any outstanding indices. Cannot be used during a transaction.
Beforehand, all nodes must be marked as Done and no cycles
on these nodes may be present. This is done by e.g. process_cycles.
fn apply_rewrites(&mut self, node_rewrites: &[usize])[src]
fn apply_rewrites(&mut self, node_rewrites: &[usize])🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Auto Trait Implementations
impl<O> Send for ObligationForest<O> where
O: Send,
<O as ForestObligation>::Predicate: Send,
impl<O> Send for ObligationForest<O> where
O: Send,
<O as ForestObligation>::Predicate: Send, impl<O> !Sync for ObligationForest<O>
impl<O> !Sync for ObligationForest<O>