TypeRelation

Trait TypeRelation 

pub trait TypeRelation<I>: Sized
where I: Interner,
{ // Required methods fn cx(&self) -> I; fn relate_ty_args( &mut self, a_ty: <I as Interner>::Ty, b_ty: <I as Interner>::Ty, ty_def_id: <I as Interner>::DefId, a_arg: <I as Interner>::GenericArgs, b_arg: <I as Interner>::GenericArgs, mk: impl FnOnce(<I as Interner>::GenericArgs) -> <I as Interner>::Ty, ) -> Result<<I as Interner>::Ty, TypeError<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 method fn relate<T>(&mut self, a: T, b: T) -> Result<T, TypeError<I>> where T: Relate<I> { ... } }

Required Methods§

fn cx(&self) -> I

fn relate_ty_args( &mut self, a_ty: <I as Interner>::Ty, b_ty: <I as Interner>::Ty, ty_def_id: <I as Interner>::DefId, a_arg: <I as Interner>::GenericArgs, b_arg: <I as Interner>::GenericArgs, mk: impl FnOnce(<I as Interner>::GenericArgs) -> <I as Interner>::Ty, ) -> Result<<I as Interner>::Ty, TypeError<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>,

Switch variance for the purpose of relating a and b.

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>,

Generic relation routine suitable for most anything.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

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

Source§

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

Source§

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

Source§

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

§

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