pub(crate) struct ConstraintConversion<'a, 'tcx> {
    infcx: &'a InferCtxt<'tcx>,
    tcx: TyCtxt<'tcx>,
    universal_regions: &'a UniversalRegions<'tcx>,
    region_bound_pairs: &'a RegionBoundPairs<'tcx>,
    implicit_region_bound: Region<'tcx>,
    param_env: ParamEnv<'tcx>,
    locations: Locations,
    span: Span,
    category: ConstraintCategory<'tcx>,
    from_closure: bool,
    constraints: &'a mut MirTypeckRegionConstraints<'tcx>,
}

Fields§

§infcx: &'a InferCtxt<'tcx>§tcx: TyCtxt<'tcx>§universal_regions: &'a UniversalRegions<'tcx>§region_bound_pairs: &'a RegionBoundPairs<'tcx>

Each RBP GK: 'a is assumed to be true. These encode relationships like T: 'a that are added via implicit bounds or the param_env.

Each region here is guaranteed to be a key in the indices map. We use the “original” regions (i.e., the keys from the map, and not the values) because the code in process_registered_region_obligations has some special-cased logic expecting to see (e.g.) ReStatic, and if we supplied our special inference variable there, we would mess that up.

§implicit_region_bound: Region<'tcx>§param_env: ParamEnv<'tcx>§locations: Locations§span: Span§category: ConstraintCategory<'tcx>§from_closure: bool§constraints: &'a mut MirTypeckRegionConstraints<'tcx>

Implementations§

Given an instance of the closure type, this method instantiates the “extra” requirements that we computed for the closure. This has the effect of adding new outlives obligations to existing region variables in closure_substs.

Placeholder regions need to be converted eagerly because it may create new region variables, which we must not do when verifying our region bounds.

FIXME: This should get removed once higher ranked region obligations are dealt with during trait solving.

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion 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: 104 bytes