Struct rustc_mir::borrow_check::constraints::graph::ConstraintGraph [−][src]
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: D
first_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]
direction: D,
set: &OutlivesConstraintSet,
num_region_vars: usize
) -> Self
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]
&'rg self,
set: &'rg OutlivesConstraintSet,
static_region: RegionVid
) -> RegionGraph<'rg, D>
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]
&'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;
Given a region R
, iterate over all constraints R: R1
.
Auto Trait Implementations
impl<D> RefUnwindSafe for ConstraintGraph<D> where
D: RefUnwindSafe,
D: RefUnwindSafe,
impl<D> Send for ConstraintGraph<D> where
D: Send,
D: Send,
impl<D> Sync for ConstraintGraph<D> where
D: Sync,
D: Sync,
impl<D> Unpin for ConstraintGraph<D> where
D: Unpin,
D: Unpin,
impl<D> UnwindSafe for ConstraintGraph<D> where
D: UnwindSafe,
D: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.