Struct rustc_mir::borrow_check::universal_regions::UniversalRegionIndices [−][src]
Fields
indices: FxHashMap<Region<'tcx>, RegionVid>Expand description
For those regions that may appear in the parameter environment
(’static and early-bound regions), we maintain a map from the
ty::Region to the internal RegionVid we are using. This is
used because trait matching and type-checking will feed us
region constraints that reference those regions and we need to
be able to map them our internal RegionVid. This is
basically equivalent to a InternalSubsts, except that it also
contains an entry for ReStatic – it might be nice to just
use a substs, and then handle ReStatic another way.
Implementations
impl<'tcx> UniversalRegionIndices<'tcx>[src]
impl<'tcx> UniversalRegionIndices<'tcx>[src]fn insert_late_bound_region(&mut self, r: Region<'tcx>, vid: RegionVid)[src]
fn insert_late_bound_region(&mut self, r: Region<'tcx>, vid: RegionVid)[src]Initially, the UniversalRegionIndices map contains only the
early-bound regions in scope. Once that is all setup, we come
in later and instantiate the late-bound regions, and then we
insert the ReFree version of those into the map as
well. These are used for error reporting.
pub fn to_region_vid(&self, r: Region<'tcx>) -> RegionVid[src]
pub fn to_region_vid(&self, r: Region<'tcx>) -> RegionVid[src]Converts r into a local inference variable: r can either
by a ReVar (i.e., already a reference to an inference
variable) or it can be 'static or some early-bound
region. This is useful when taking the results from
type-checking and trait-matching, which may sometimes
reference those regions from the ParamEnv. It is also used
during initialization. Relies on the indices map having been
fully initialized.
pub fn fold_to_region_vids<T>(&self, tcx: TyCtxt<'tcx>, value: T) -> T where
T: TypeFoldable<'tcx>, [src]
pub fn fold_to_region_vids<T>(&self, tcx: TyCtxt<'tcx>, value: T) -> T where
T: TypeFoldable<'tcx>, [src]Replaces all free regions in value with region vids, as
returned by to_region_vid.
Trait Implementations
Auto Trait Implementations
impl<'tcx> RefUnwindSafe for UniversalRegionIndices<'tcx>
impl<'tcx> Send for UniversalRegionIndices<'tcx>
impl<'tcx> Sync for UniversalRegionIndices<'tcx>
impl<'tcx> Unpin for UniversalRegionIndices<'tcx>
impl<'tcx> UnwindSafe for UniversalRegionIndices<'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]