Struct rustc_infer::infer::combine::CombineFields[][src]

pub struct CombineFields<'infcx, 'tcx> {
    pub infcx: &'infcx InferCtxt<'infcx, 'tcx>,
    pub trace: TypeTrace<'tcx>,
    pub cause: Option<Cause>,
    pub param_env: ParamEnv<'tcx>,
    pub obligations: PredicateObligations<'tcx>,
}

Fields

infcx: &'infcx InferCtxt<'infcx, 'tcx>trace: TypeTrace<'tcx>cause: Option<Cause>param_env: ParamEnv<'tcx>obligations: PredicateObligations<'tcx>

Implementations

Here, dir is either EqTo, SubtypeOf, or SupertypeOf. The idea is that we should ensure that the type a_ty is equal to, a subtype of, or a supertype of (respectively) the type to which b_vid is bound.

Since b_vid has not yet been instantiated with a type, we will first instantiate b_vid with a generalized version of a_ty. Generalization introduces other inference variables wherever subtyping could occur.

Attempts to generalize ty for the type variable for_vid. This checks for cycle – that is, whether the type ty references for_vid. The dir is the “direction” for which we a performing the generalization (i.e., are we producing a type that can be used as a supertype etc).

Preconditions:

  • for_vid is a “root vid”

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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: 112 bytes