[−][src]Struct rustc_data_structures::graph::scc::SccsConstruction
🔬 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
graph: &'c G
🔬 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?
node_states: IndexVec<G::Node, NodeState<G::Node, S>>
🔬 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 state of each node; used during walk to record the stack and after walk to record what cycle each node ended up being in.
node_stack: Vec<G::Node>
🔬 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 stack of nodes that we are visiting as part of the DFS.
successors_stack: Vec<S>
🔬 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 stack of successors: as we visit a node, we mark our position in this stack, and when we encounter a successor SCC, we push it on the stack. When we complete an SCC, we can pop everything off the stack that was found along the way.
duplicate_set: FxHashSet<S>
🔬 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 set used to strip duplicates. As we accumulate successors into the successors_stack, we sometimes get duplicate entries. We use this set to remove those -- we also keep its storage around between successors to amortize memory allocation costs.
scc_data: SccData<S>
🔬 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<'c, G, S> SccsConstruction<'c, G, S> where
G: DirectedGraph + WithNumNodes + WithSuccessors,
S: Idx,
[src]
impl<'c, G, S> SccsConstruction<'c, G, S> where
G: DirectedGraph + WithNumNodes + WithSuccessors,
S: Idx,
fn construct(graph: &'c G) -> Sccs<G::Node, S>
[src]
fn construct(graph: &'c G) -> Sccs<G::Node, S>
🔬 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?
Identifies SCCs in the graph G
and computes the resulting
DAG. This uses a variant of Tarjan's
algorithm. The high-level summary of the algorithm
is that we do a depth-first search. Along the way, we keep a
stack of each node whose successors are being visited. We
track the depth of each node on this stack (there is no depth
if the node is not on the stack). When we find that some node
N with depth D can reach some other node N' with lower depth
D' (i.e., D' < D), we know that N, N', and all nodes in
between them on the stack are part of an SCC.
fn walk_node(&mut self, depth: usize, node: G::Node) -> WalkReturn<S>
[src]
fn walk_node(&mut self, depth: usize, node: G::Node) -> WalkReturn<S>
🔬 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?
Visit a node during the DFS. We first examine its current
state -- if it is not yet visited (NotVisited
), we can push
it onto the stack and start walking its successors.
If it is already on the DFS stack it will be in the state
BeingVisited
. In that case, we have found a cycle and we
return the depth from the stack.
Otherwise, we are looking at a node that has already been
completely visited. We therefore return WalkReturn::Complete
with its associated SCC index.
fn find_state(&mut self, r: G::Node) -> NodeState<G::Node, S>
[src]
fn find_state(&mut self, r: G::Node) -> NodeState<G::Node, S>
🔬 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?
Fetches the state of the node r
. If r
is recorded as being
in a cycle with some other node r2
, then fetches the state
of r2
(and updates r
to reflect current result). This is
basically the "find" part of a standard union-find algorithm
(with path compression).
fn walk_unvisited_node(&mut self, depth: usize, node: G::Node) -> WalkReturn<S>
[src]
fn walk_unvisited_node(&mut self, depth: usize, node: G::Node) -> WalkReturn<S>
🔬 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?
Walks a node that has never been visited before.
Auto Trait Implementations
impl<'c, G, S> Send for SccsConstruction<'c, G, S> where
G: Sync,
S: Send,
<G as DirectedGraph>::Node: Idx + Send,
impl<'c, G, S> Send for SccsConstruction<'c, G, S> where
G: Sync,
S: Send,
<G as DirectedGraph>::Node: Idx + Send,
impl<'c, G, S> Sync for SccsConstruction<'c, G, S> where
G: Sync,
S: Sync,
<G as DirectedGraph>::Node: Sync,
impl<'c, G, S> Sync for SccsConstruction<'c, G, S> where
G: Sync,
S: Sync,
<G as DirectedGraph>::Node: Sync,
Blanket Implementations
impl<T> Erased for T
[src]
impl<T> Erased for T
impl<T> Send for T where
T: ?Sized,
[src]
impl<T> Send for T where
T: ?Sized,
impl<T> Sync for T where
T: ?Sized,
[src]
impl<T> Sync for T where
T: ?Sized,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
ⓘImportant traits for &'a mut Rfn borrow(&self) -> &T
[src]
fn borrow(&self) -> &T
Immutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
ⓘImportant traits for &'a mut Rfn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<E> SpecializationError for E
[src]
impl<E> SpecializationError for E
fn not_found<S, T>(trait_name: &'static str, method_name: &'static str) -> E where
T: ?Sized,
[src]
fn not_found<S, T>(trait_name: &'static str, method_name: &'static str) -> E where
T: ?Sized,
🔬 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?
Create an error for a missing method specialization. Defaults to panicking with type, trait & method names. S
is the encoder/decoder state type, T
is the type being encoded/decoded, and the arguments are the names of the trait and method that should've been overridden. Read more
impl<T> Erased for T
impl<T> Erased for T