Struct rustc_mir::borrow_check::type_check::free_region_relations::UniversalRegionRelations [−][src]
pub(crate) struct UniversalRegionRelations<'tcx> {
universal_regions: Rc<UniversalRegions<'tcx>>,
outlives: TransitiveRelation<RegionVid>,
inverse_outlives: TransitiveRelation<RegionVid>,
}Fields
universal_regions: Rc<UniversalRegions<'tcx>>outlives: TransitiveRelation<RegionVid>Expand description
Stores the outlives relations that are known to hold from the implied bounds, in-scope where-clauses, and that sort of thing.
inverse_outlives: TransitiveRelation<RegionVid>Expand description
This is the <= relation; that is, if a: b, then b <= a,
and we store that here. This is useful when figuring out how
to express some local region in terms of external regions our
caller will understand.
Implementations
impl<'tcx> UniversalRegionRelations<'tcx>[src]
impl<'tcx> UniversalRegionRelations<'tcx>[src]fn relate_universal_regions(&mut self, fr_a: RegionVid, fr_b: RegionVid)[src]
fn relate_universal_regions(&mut self, fr_a: RegionVid, fr_b: RegionVid)[src]Records in the outlives_relation (and
inverse_outlives_relation) that fr_a: fr_b. Invoked by the
builder below.
pub(crate) fn postdom_upper_bound(
&self,
fr1: RegionVid,
fr2: RegionVid
) -> RegionVid[src]
pub(crate) fn postdom_upper_bound(
&self,
fr1: RegionVid,
fr2: RegionVid
) -> RegionVid[src]Given two universal regions, returns the postdominating upper-bound (effectively the least upper bound).
(See TransitiveRelation::postdom_upper_bound for details on
the postdominating upper bound in general.)
pub(crate) fn non_local_upper_bounds<'a>(
&'a self,
fr: &'a RegionVid
) -> Vec<&'a RegionVid>[src]
pub(crate) fn non_local_upper_bounds<'a>(
&'a self,
fr: &'a RegionVid
) -> Vec<&'a RegionVid>[src]Finds an “upper bound” for fr that is not local. In other
words, returns the smallest (*) known region fr1 that (a)
outlives fr and (b) is not local.
(*) If there are multiple competing choices, we return all of them.
pub(crate) fn non_local_upper_bound(&self, fr: RegionVid) -> RegionVid[src]
pub(crate) fn non_local_upper_bound(&self, fr: RegionVid) -> RegionVid[src]Returns the “postdominating” bound of the set of
non_local_upper_bounds for the given region.
pub(crate) fn non_local_lower_bound(&self, fr: RegionVid) -> Option<RegionVid>[src]
pub(crate) fn non_local_lower_bound(&self, fr: RegionVid) -> Option<RegionVid>[src]Finds a “lower bound” for fr that is not local. In other
words, returns the largest (*) known region fr1 that (a) is
outlived by fr and (b) is not local.
(*) If there are multiple competing choices, we pick the “postdominating”
one. See TransitiveRelation::postdom_upper_bound for details.
fn non_local_bounds<'a>(
&self,
relation: &'a TransitiveRelation<RegionVid>,
fr0: &'a RegionVid
) -> Vec<&'a RegionVid>[src]
fn non_local_bounds<'a>(
&self,
relation: &'a TransitiveRelation<RegionVid>,
fr0: &'a RegionVid
) -> Vec<&'a RegionVid>[src]Helper for non_local_upper_bounds and non_local_lower_bounds.
Repeatedly invokes postdom_parent until we find something that is not
local. Returns None if we never do so.
pub(crate) fn outlives(&self, fr1: RegionVid, fr2: RegionVid) -> bool[src]
pub(crate) fn outlives(&self, fr1: RegionVid, fr2: RegionVid) -> bool[src]Returns true if fr1 is known to outlive fr2.
This will only ever be true for universally quantified regions.
pub(crate) fn regions_outlived_by(&self, fr1: RegionVid) -> Vec<&RegionVid>[src]
pub(crate) fn regions_outlived_by(&self, fr1: RegionVid) -> Vec<&RegionVid>[src]Returns a vector of free regions x such that fr1: x is
known to hold.
Trait Implementations
impl<'tcx> Debug for UniversalRegionRelations<'tcx>[src]
impl<'tcx> Debug for UniversalRegionRelations<'tcx>[src]impl<'tcx> FreeRegionRelations<'tcx> for UniversalRegionRelations<'tcx>[src]
impl<'tcx> FreeRegionRelations<'tcx> for UniversalRegionRelations<'tcx>[src]This trait is used by the impl-trait constraint code to abstract
over the FreeRegionMap from lexical regions and
UniversalRegions (from NLL)`.
Auto Trait Implementations
impl<'tcx> !RefUnwindSafe for UniversalRegionRelations<'tcx>
impl<'tcx> !Send for UniversalRegionRelations<'tcx>
impl<'tcx> !Sync for UniversalRegionRelations<'tcx>
impl<'tcx> Unpin for UniversalRegionRelations<'tcx>
impl<'tcx> !UnwindSafe for UniversalRegionRelations<'tcx>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> WithConstness for T[src]
impl<T> WithConstness for T[src]