Function rustc_const_eval::util::compare_types::relate_types

source ยท
pub fn relate_types<'tcx>(
    tcx: TyCtxt<'tcx>,
    param_env: ParamEnv<'tcx>,
    variance: Variance,
    src: Ty<'tcx>,
    dest: Ty<'tcx>
) -> bool
Expand description

Returns whether src is a subtype of dest, i.e. src <: dest.

When validating assignments, the variance should be Covariant. When checking during MirPhase >= MirPhase::Runtime(RuntimePhase::Initial) variance should be Invariant because we want to check for type equality.