Struct rustc_mir::borrow_check::constraints::graph::ConstraintGraph[][src]

pub(crate) struct ConstraintGraph<D: ConstraintGraphDirecton> {
    _direction: D,
    first_constraints: IndexVec<RegionVid, Option<OutlivesConstraintIndex>>,
    next_constraints: IndexVec<OutlivesConstraintIndex, Option<OutlivesConstraintIndex>>,
}

The construct graph organizes the constraints by their end-points. It can be used to view a R1: R2 constraint as either an edge R1 -> R2 or R2 -> R1 depending on the direction type D.

Fields

_direction: Dfirst_constraints: IndexVec<RegionVid, Option<OutlivesConstraintIndex>>next_constraints: IndexVec<OutlivesConstraintIndex, Option<OutlivesConstraintIndex>>

Implementations

impl<D: ConstraintGraphDirecton> ConstraintGraph<D>[src]

pub(crate) fn new(
    direction: D,
    set: &OutlivesConstraintSet,
    num_region_vars: usize
) -> Self
[src]

Creates a “dependency graph” where each region constraint R1: R2 is treated as an edge R1 -> R2. We use this graph to construct SCCs for region inference but also for error reporting.

pub(crate) fn region_graph<'rg>(
    &'rg self,
    set: &'rg OutlivesConstraintSet,
    static_region: RegionVid
) -> RegionGraph<'rg, D>
[src]

Given the constraint set from which this graph was built creates a region graph so that you can iterate over regions and not constraints.

pub(crate) fn outgoing_edges<'a>(
    &'a self,
    region_sup: RegionVid,
    constraints: &'a OutlivesConstraintSet,
    static_region: RegionVid
) -> Edges<'a, D>

Notable traits for Edges<'s, D>

impl<'s, D: ConstraintGraphDirecton> Iterator for Edges<'s, D> type Item = OutlivesConstraint;
[src]

Given a region R, iterate over all constraints R: R1.

Auto Trait Implementations

impl<D> RefUnwindSafe for ConstraintGraph<D> where
    D: RefUnwindSafe

impl<D> Send for ConstraintGraph<D> where
    D: Send

impl<D> Sync for ConstraintGraph<D> where
    D: Sync

impl<D> Unpin for ConstraintGraph<D> where
    D: Unpin

impl<D> UnwindSafe for ConstraintGraph<D> where
    D: UnwindSafe

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<T> From<T> for T[src]

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

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]