[][src]Trait rustc_mir::borrow_check::universal_regions::InferCtxtExt

trait InferCtxtExt<'tcx> {
    fn replace_free_regions_with_nll_infer_vars<T>(
        &self,
        origin: NLLRegionVariableOrigin,
        value: &T
    ) -> T
    where
        T: TypeFoldable<'tcx>
;
fn replace_bound_regions_with_nll_infer_vars<T>(
        &self,
        origin: NLLRegionVariableOrigin,
        all_outlive_scope: LocalDefId,
        value: &Binder<T>,
        indices: &mut UniversalRegionIndices<'tcx>
    ) -> T
    where
        T: TypeFoldable<'tcx>
;
fn replace_late_bound_regions_with_nll_infer_vars(
        &self,
        mir_def_id: LocalDefId,
        indices: &mut UniversalRegionIndices<'tcx>
    ); }

Required methods

fn replace_free_regions_with_nll_infer_vars<T>(
    &self,
    origin: NLLRegionVariableOrigin,
    value: &T
) -> T where
    T: TypeFoldable<'tcx>, 

fn replace_bound_regions_with_nll_infer_vars<T>(
    &self,
    origin: NLLRegionVariableOrigin,
    all_outlive_scope: LocalDefId,
    value: &Binder<T>,
    indices: &mut UniversalRegionIndices<'tcx>
) -> T where
    T: TypeFoldable<'tcx>, 

fn replace_late_bound_regions_with_nll_infer_vars(
    &self,
    mir_def_id: LocalDefId,
    indices: &mut UniversalRegionIndices<'tcx>
)

Loading content...

Implementations on Foreign Types

impl<'cx, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'cx, 'tcx>[src]

fn replace_late_bound_regions_with_nll_infer_vars(
    &self,
    mir_def_id: LocalDefId,
    indices: &mut UniversalRegionIndices<'tcx>
)
[src]

Finds late-bound regions that do not appear in the parameter listing and adds them to the indices vector. Typically, we identify late-bound regions as we process the inputs and outputs of the closure/function. However, sometimes there are late-bound regions which do not appear in the fn parameters but which are nonetheless in scope. The simplest case of this are unused functions, like fn foo<'a>() { } (see e.g., #51351). Despite not being used, users can still reference these regions (e.g., let x: &'a u32 = &22;), so we need to create entries for them and store them in the indices map. This code iterates over the complete set of late-bound regions and checks for any that we have not yet seen, adding them to the inputs vector.

Loading content...

Implementors

Loading content...