Struct rustc::middle::infer::region_inference::RegionVarBindings [−] [src]

pub struct RegionVarBindings<'a, 'tcx> {
    // some fields omitted
}
Unstable

Methods

impl<'a, 'tcx> RegionVarBindings<'a, 'tcx>

fn new(tcx: &'a ctxt<'tcx>) -> RegionVarBindings<'a, 'tcx>

Unstable

fn start_snapshot(&self) -> RegionSnapshot

Unstable

fn commit(&self, snapshot: RegionSnapshot)

Unstable

fn rollback_to(&self, snapshot: RegionSnapshot)

Unstable

fn num_vars(&self) -> u32

Unstable

fn new_region_var(&self, origin: RegionVariableOrigin) -> RegionVid

Unstable

fn new_skolemized(&self, br: BoundRegion, snapshot: &RegionSnapshot) -> Region

Unstable

Creates a new skolemized region. Skolemized regions are fresh regions used when performing higher-ranked computations. They must be used in a very particular way and are never supposed to "escape" out into error messages or the code at large.

The idea is to always create a snapshot. Skolemized regions can be created in the context of this snapshot, but once the snapshot is committed or rolled back, their numbers will be recycled, so you must be finished with them. See the extensive comments in higher_ranked.rs to see how it works (in particular, the subtyping comparison).

The snapshot argument to this function is not really used; it's just there to make it explicit which snapshot bounds the skolemized region that results.

fn new_bound(&self, debruijn: DebruijnIndex) -> Region

Unstable

fn add_given(&self, sub: FreeRegion, sup: RegionVid)

Unstable

fn make_eqregion(&self, origin: SubregionOrigin<'tcx>, sub: Region, sup: Region)

Unstable

fn make_subregion(&self, origin: SubregionOrigin<'tcx>, sub: Region, sup: Region)

Unstable

fn verify_generic_bound(&self, origin: SubregionOrigin<'tcx>, kind: GenericKind<'tcx>, sub: Region, sups: Vec<Region>)

Unstable

See Verify::VerifyGenericBound

fn lub_regions(&self, origin: SubregionOrigin<'tcx>, a: Region, b: Region) -> Region

Unstable

fn glb_regions(&self, origin: SubregionOrigin<'tcx>, a: Region, b: Region) -> Region

Unstable

fn resolve_var(&self, rid: RegionVid) -> Region

Unstable

fn combine_vars<F>(&self, t: CombineMapType, a: Region, b: Region, origin: SubregionOrigin<'tcx>, relate: F) -> Region where F: FnMut(&RegionVarBindings<'a, 'tcx>, Region, Region)

Unstable

fn vars_created_since_snapshot(&self, mark: &RegionSnapshot) -> Vec<RegionVid>

Unstable

fn tainted(&self, mark: &RegionSnapshot, r0: Region) -> Vec<Region>

Unstable

Computes all regions that have been related to r0 in any way since the mark mark was made---r0 itself will be the first entry. This is used when checking whether skolemized regions are being improperly related to other regions.

fn resolve_regions(&self, free_regions: &FreeRegionMap, subject_node: NodeId) -> Vec<RegionResolutionError<'tcx>>

Unstable

This function performs the actual region resolution. It must be called after all constraints have been added. It performs a fixed-point iteration to find region values which satisfy all constraints, assuming such values can be found; if they cannot, errors are reported.