rustc_trait_selection::infer::relate

Trait TypeRelation

source
pub trait TypeRelation<I>: Sized
where I: Interner,
{ // Required methods fn cx(&self) -> I; fn relate_with_variance<T>( &mut self, variance: Variance, info: VarianceDiagInfo<I>, a: T, b: T, ) -> Result<T, TypeError<I>> where T: Relate<I>; fn tys( &mut self, a: <I as Interner>::Ty, b: <I as Interner>::Ty, ) -> Result<<I as Interner>::Ty, TypeError<I>>; fn regions( &mut self, a: <I as Interner>::Region, b: <I as Interner>::Region, ) -> Result<<I as Interner>::Region, TypeError<I>>; fn consts( &mut self, a: <I as Interner>::Const, b: <I as Interner>::Const, ) -> Result<<I as Interner>::Const, TypeError<I>>; fn binders<T>( &mut self, a: Binder<I, T>, b: Binder<I, T>, ) -> Result<Binder<I, T>, TypeError<I>> where T: Relate<I>; // Provided methods fn relate<T>(&mut self, a: T, b: T) -> Result<T, TypeError<I>> where T: Relate<I> { ... } fn relate_item_args( &mut self, item_def_id: <I as Interner>::DefId, a_arg: <I as Interner>::GenericArgs, b_arg: <I as Interner>::GenericArgs, ) -> Result<<I as Interner>::GenericArgs, TypeError<I>> { ... } }

Required Methods§

source

fn cx(&self) -> I

source

fn relate_with_variance<T>( &mut self, variance: Variance, info: VarianceDiagInfo<I>, a: T, b: T, ) -> Result<T, TypeError<I>>
where T: Relate<I>,

Switch variance for the purpose of relating a and b.

source

fn tys( &mut self, a: <I as Interner>::Ty, b: <I as Interner>::Ty, ) -> Result<<I as Interner>::Ty, TypeError<I>>

source

fn regions( &mut self, a: <I as Interner>::Region, b: <I as Interner>::Region, ) -> Result<<I as Interner>::Region, TypeError<I>>

source

fn consts( &mut self, a: <I as Interner>::Const, b: <I as Interner>::Const, ) -> Result<<I as Interner>::Const, TypeError<I>>

source

fn binders<T>( &mut self, a: Binder<I, T>, b: Binder<I, T>, ) -> Result<Binder<I, T>, TypeError<I>>
where T: Relate<I>,

Provided Methods§

source

fn relate<T>(&mut self, a: T, b: T) -> Result<T, TypeError<I>>
where T: Relate<I>,

Generic relation routine suitable for most anything.

source

fn relate_item_args( &mut self, item_def_id: <I as Interner>::DefId, a_arg: <I as Interner>::GenericArgs, b_arg: <I as Interner>::GenericArgs, ) -> Result<<I as Interner>::GenericArgs, TypeError<I>>

Relate the two args for the given item. The default is to look up the variance for the item and proceed accordingly.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'tcx> TypeRelation<TyCtxt<'tcx>> for SameTypeModuloInfer<'_, 'tcx>

source§

impl<'tcx> TypeRelation<TyCtxt<'tcx>> for MatchAgainstFreshVars<'tcx>

source§

impl<Infcx, I> TypeRelation<I> for SolverRelating<'_, Infcx, I>
where Infcx: InferCtxtLike<Interner = I>, I: Interner,