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<'tcx, T>,
        indices: &mut UniversalRegionIndices<'tcx>
    ) -> T
    where
        T: TypeFoldable<'tcx>
; fn replace_late_bound_regions_with_nll_infer_vars_in_recursive_scope(
        &self,
        mir_def_id: LocalDefId,
        indices: &mut UniversalRegionIndices<'tcx>
    ); fn replace_late_bound_regions_with_nll_infer_vars_in_item(
        &self,
        mir_def_id: LocalDefId,
        indices: &mut UniversalRegionIndices<'tcx>
    ); }

Required Methods§

Implementations on Foreign Types§

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.

Implementors§