[][src]Trait rustc_mir::borrow_check::region_infer::ClosureRegionRequirementsExt

pub trait ClosureRegionRequirementsExt<'tcx> {
    fn apply_requirements(
        &self,
        tcx: TyCtxt<'tcx>,
        closure_def_id: DefId,
        closure_substs: SubstsRef<'tcx>
    ) -> Vec<QueryOutlivesConstraint<'tcx>>; }

Required methods

fn apply_requirements(
    &self,
    tcx: TyCtxt<'tcx>,
    closure_def_id: DefId,
    closure_substs: SubstsRef<'tcx>
) -> Vec<QueryOutlivesConstraint<'tcx>>

Loading content...

Implementations on Foreign Types

impl<'tcx> ClosureRegionRequirementsExt<'tcx> for ClosureRegionRequirements<'tcx>[src]

fn apply_requirements(
    &self,
    tcx: TyCtxt<'tcx>,
    closure_def_id: DefId,
    closure_substs: SubstsRef<'tcx>
) -> Vec<QueryOutlivesConstraint<'tcx>>
[src]

Given an instance T of the closure type, this method instantiates the "extra" requirements that we computed for the closure into the inference context. This has the effect of adding new outlives obligations to existing variables.

As described on ClosureRegionRequirements, the extra requirements are expressed in terms of regionvids that index into the free regions that appear on the closure type. So, to do this, we first copy those regions out from the type T into a vector. Then we can just index into that vector to extract out the corresponding region from T and apply the requirements.

Loading content...

Implementors

Loading content...