Struct rustc_borrowck::BorrowckInferCtxt
source · pub struct BorrowckInferCtxt<'cx, 'tcx> {
pub(crate) infcx: &'cx InferCtxt<'tcx>,
pub(crate) reg_var_to_origin: RefCell<FxIndexMap<RegionVid, RegionCtxt>>,
}
Fields§
§infcx: &'cx InferCtxt<'tcx>
§reg_var_to_origin: RefCell<FxIndexMap<RegionVid, RegionCtxt>>
Implementations§
source§impl<'cx, 'tcx> BorrowckInferCtxt<'cx, 'tcx>
impl<'cx, 'tcx> BorrowckInferCtxt<'cx, 'tcx>
pub(crate) fn new(infcx: &'cx InferCtxt<'tcx>) -> Self
pub(crate) fn next_region_var<F>( &self, origin: RegionVariableOrigin, get_ctxt_fn: F ) -> Region<'tcx>where F: Fn() -> RegionCtxt,
pub(crate) fn next_nll_region_var<F>( &self, origin: NllRegionVariableOrigin, get_ctxt_fn: F ) -> Region<'tcx>where F: Fn() -> RegionCtxt,
Trait Implementations§
source§impl<'cx, 'tcx> Deref for BorrowckInferCtxt<'cx, 'tcx>
impl<'cx, 'tcx> Deref for BorrowckInferCtxt<'cx, 'tcx>
source§impl<'cx, 'tcx> InferCtxtExt<'tcx> for BorrowckInferCtxt<'cx, 'tcx>
impl<'cx, 'tcx> InferCtxtExt<'tcx> for BorrowckInferCtxt<'cx, 'tcx>
source§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_recursive_scope( &self, mir_def_id: LocalDefId, indices: &mut UniversalRegionIndices<'tcx> )
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.
fn replace_free_regions_with_nll_infer_vars<T>( &self, origin: NllRegionVariableOrigin, value: T ) -> Twhere T: TypeFoldable<TyCtxt<'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> ) -> Twhere T: TypeFoldable<TyCtxt<'tcx>>,
fn replace_late_bound_regions_with_nll_infer_vars_in_item( &self, mir_def_id: LocalDefId, indices: &mut UniversalRegionIndices<'tcx> )
Auto Trait Implementations§
impl<'cx, 'tcx> !RefUnwindSafe for BorrowckInferCtxt<'cx, 'tcx>
impl<'cx, 'tcx> !Send for BorrowckInferCtxt<'cx, 'tcx>
impl<'cx, 'tcx> !Sync for BorrowckInferCtxt<'cx, 'tcx>
impl<'cx, 'tcx> Unpin for BorrowckInferCtxt<'cx, 'tcx>
impl<'cx, 'tcx> !UnwindSafe for BorrowckInferCtxt<'cx, 'tcx>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 72 bytes