pub struct TypeRelating<'me, 'tcx, D> where
    D: TypeRelatingDelegate<'tcx>, 
{ infcx: &InferCtxt, delegate: D, ambient_variance: Variance, ambient_variance_info: VarianceDiagInfo, a_scopes: Vec<BoundRegionScope, Global>, b_scopes: Vec<BoundRegionScope, Global>, }

Fields

infcx: &InferCtxtdelegate: D

Callback to use when we deduce an outlives relationship.

ambient_variance: Variance

How are we relating a and b?

  • Covariant means a <: b.
  • Contravariant means b <: a.
  • Invariant means `a == b.
  • Bivariant means that it doesn’t matter.
ambient_variance_info: VarianceDiagInfoa_scopes: Vec<BoundRegionScope, Global>

When we pass through a set of binders (e.g., when looking into a fn type), we push a new bound region scope onto here. This will contain the instantiated region for each region in those binders. When we then encounter a ReLateBound(d, br), we can use the De Bruijn index d to find the right scope, and then bound region name br to find the specific instantiation from within that scope. See replace_bound_region.

This field stores the instantiations for late-bound regions in the a type.

b_scopes: Vec<BoundRegionScope, Global>

Same as a_scopes, but for the b type.

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

Performs the conversion.

Performs the conversion.

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: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.