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>

source

pub(crate) fn new(infcx: &'cx InferCtxt<'tcx>) -> Self

source

pub(crate) fn next_region_var<F>( &self, origin: RegionVariableOrigin, get_ctxt_fn: F ) -> Region<'tcx>where F: Fn() -> RegionCtxt,

source

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>

§

type Target = InferCtxt<'tcx>

The resulting type after dereferencing.
source§

fn deref(&self) -> &'cx Self::Target

Dereferences the value.
source§

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> )

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.

source§

fn replace_free_regions_with_nll_infer_vars<T>( &self, origin: NllRegionVariableOrigin, value: T ) -> Twhere T: TypeFoldable<TyCtxt<'tcx>>,

source§

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>>,

source§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.

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