[−][src]Trait rustc_infer::infer::nll_relate::VidValuePair

pub(in infer::nll_relate) trait VidValuePair<'tcx>: Debug {
    pub(in infer::nll_relate) fn vid(
        &self
    ) -> TyVid;
pub(in infer::nll_relate) fn value_ty(
        &self
    ) -> Ty<'tcx>;
pub(in infer::nll_relate) fn vid_scopes<D: TypeRelatingDelegate<'tcx>, 'r>(
        &self,
        relate: &'r mut TypeRelating<'_, 'tcx, D>
    ) -> &'r mut Vec<BoundRegionScope<'tcx>>;
pub(in infer::nll_relate) fn relate_generalized_ty<D>(
        &self,
        relate: &mut TypeRelating<'_, 'tcx, D>,
        generalized_ty: Ty<'tcx>
    ) -> RelateResult<'tcx, Ty<'tcx>>
    where
        D: TypeRelatingDelegate<'tcx>
; }

When we instantiate a inference variable with a value in relate_ty_var, we always have the pair of a TyVid and a Ty, but the ordering may vary (depending on whether the inference variable was found on the a or b sides). Therefore, this trait allows us to factor out common code, while preserving the order when needed.

Required methods

pub(in infer::nll_relate) fn vid(
    &self
) -> TyVid
[src]

Extract the inference variable (which could be either the first or second part of the tuple).

pub(in infer::nll_relate) fn value_ty(
    &self
) -> Ty<'tcx>
[src]

Extract the value it is being related to (which will be the opposite part of the tuple from the vid).

pub(in infer::nll_relate) fn vid_scopes<D: TypeRelatingDelegate<'tcx>, 'r>(
    &self,
    relate: &'r mut TypeRelating<'_, 'tcx, D>
) -> &'r mut Vec<BoundRegionScope<'tcx>>
[src]

Extract the scopes that apply to whichever side of the tuple the vid was found on. See the comment where this is called for more details on why we want them.

pub(in infer::nll_relate) fn relate_generalized_ty<D>(
    &self,
    relate: &mut TypeRelating<'_, 'tcx, D>,
    generalized_ty: Ty<'tcx>
) -> RelateResult<'tcx, Ty<'tcx>> where
    D: TypeRelatingDelegate<'tcx>, 
[src]

Given a generalized type G that should replace the vid, relate G to the value, putting G on whichever side the vid would have appeared.

Loading content...

Implementations on Foreign Types

impl<'tcx> VidValuePair<'tcx> for (TyVid, Ty<'tcx>)[src]

impl<'tcx> VidValuePair<'tcx> for (Ty<'tcx>, TyVid)[src]

Loading content...

Implementors

Loading content...