rustc_borrowck::region_infer

Type Alias ConstraintSccs

Source
pub(crate) type ConstraintSccs = Sccs<RegionVid, ConstraintSccIndex, RegionTracker>;

Aliased Type§

struct ConstraintSccs { /* private fields */ }

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: 72 bytes

Implementations

Source§

impl<N, S, A> Sccs<N, S, A>
where N: Idx, S: Idx + Ord, A: Annotation,

Source

pub fn new_with_annotation<F>( graph: &impl Successors<Node = N>, to_annotation: F, ) -> Sccs<N, S, A>
where F: Fn(N) -> A,

Compute SCCs and annotate them with a user-supplied annotation

Source

pub fn annotation(&self, scc: S) -> A

Source

pub fn scc_indices(&self) -> &IndexSlice<N, S>

Source

pub fn num_sccs(&self) -> usize

Returns the number of SCCs in the graph.

Source

pub fn all_sccs(&self) -> impl Iterator<Item = S>

Returns an iterator over the SCCs in the graph.

The SCCs will be iterated in dependency order (or post order), meaning that if S1 -> S2, we will visit S2 first and S1 after. This is convenient when the edges represent dependencies: when you visit S1, the value for S2 will already have been computed.

Source

pub fn scc(&self, r: N) -> S

Returns the SCC to which a node r belongs.

Source

pub fn successors(&self, scc: S) -> &[S]

Returns the successors of the given SCC.

Source

pub fn reverse(&self) -> VecGraph<S>

Construct the reverse graph of the SCC graph.

Trait Implementations

Source§

impl<N, S, A> DirectedGraph for Sccs<N, S, A>
where N: Idx, S: Idx + Ord, A: Annotation,

Source§

type Node = S

Source§

fn num_nodes(&self) -> usize

Source§

impl<N, S, A> NumEdges for Sccs<N, S, A>
where N: Idx, S: Idx + Ord, A: Annotation,

Source§

impl<N, S, A> Successors for Sccs<N, S, A>
where N: Idx, S: Idx + Ord, A: Annotation,

Source§

fn successors(&self, node: S) -> impl Iterator<Item = S>