Skip to main content

TypeRelation

Trait TypeRelation 

Source
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§

Source

fn cx(&self) -> I

Source

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

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

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

Source§

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

Source§

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