Relate in rustc_infer::infer::canonical::ir::relate - Rust
Description: API documentation for the Rust `Relate` trait in crate `rustc_infer`.

Skip to main content

## Relate

# Trait Relate

Source

    pub trait Relate<I>:
        TypeFoldable<I>
        + PartialEq
        + Copywhere
        I: Interner,{
        // Required method
        fn relate<R>(
            relation: &mut R,
            a: Self,
            b: Self,
        ) -> Result<Self, TypeError<I>>
           where R: TypeRelation<I>;
    }

## Required Methods§

Source

#### fn relate<R>(relation: &mut R, a: Self, b: Self) -> Result<Self, TypeError<I>>
where R: TypeRelation<I>,

## Dyn Compatibility§

This trait is not dyn compatible.

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

## Implementations on Foreign Types§

Source§

### impl<'tcx> Relate<TyCtxt<'tcx>> for Expr<'tcx>

Source§

#### fn relate<R>( relation: &mut R, ae: Expr<'tcx>, be: Expr<'tcx>, ) -> Result<Expr<'tcx>, TypeError<TyCtxt<'tcx>>>
where R: TypeRelation<TyCtxt<'tcx>>,

Source§

### impl<'tcx> Relate<TyCtxt<'tcx>> for Const<'tcx>

Source§

#### fn relate<R>( relation: &mut R, a: Const<'tcx>, b: Const<'tcx>, ) -> Result<Const<'tcx>, TypeError<TyCtxt<'tcx>>>
where R: TypeRelation<TyCtxt<'tcx>>,

Source§

### impl<'tcx> Relate<TyCtxt<'tcx>> for GenericArg<'tcx>

Source§

#### fn relate<R>( relation: &mut R, a: GenericArg<'tcx>, b: GenericArg<'tcx>, ) -> Result<GenericArg<'tcx>, TypeError<TyCtxt<'tcx>>>
where R: TypeRelation<TyCtxt<'tcx>>,

Source§

### impl<'tcx> Relate<TyCtxt<'tcx>> for Pattern<'tcx>

Source§

#### fn relate<R>( relation: &mut R, a: Pattern<'tcx>, b: Pattern<'tcx>, ) -> Result<Pattern<'tcx>, TypeError<TyCtxt<'tcx>>>
where R: TypeRelation<TyCtxt<'tcx>>,

Source§

### impl<'tcx> Relate<TyCtxt<'tcx>> for Region<'tcx>

Source§

#### fn relate<R>( relation: &mut R, a: Region<'tcx>, b: Region<'tcx>, ) -> Result<Region<'tcx>, TypeError<TyCtxt<'tcx>>>
where R: TypeRelation<TyCtxt<'tcx>>,

Source§

### impl<'tcx> Relate<TyCtxt<'tcx>> for Term<'tcx>

Source§

#### fn relate<R>( relation: &mut R, a: Term<'tcx>, b: Term<'tcx>, ) -> Result<Term<'tcx>, TypeError<TyCtxt<'tcx>>>
where R: TypeRelation<TyCtxt<'tcx>>,

Source§

### impl<'tcx> Relate<TyCtxt<'tcx>> for Ty<'tcx>

Source§

#### fn relate<R>( relation: &mut R, a: Ty<'tcx>, b: Ty<'tcx>, ) -> Result<Ty<'tcx>, TypeError<TyCtxt<'tcx>>>
where R: TypeRelation<TyCtxt<'tcx>>,

## Implementors§

Source§

### impl<I> Relate<I> for AliasTerm<I>
where I: Interner,

Source§

### impl<I> Relate<I> for AliasTy<I>
where I: Interner,

Source§

### impl<I> Relate<I> for ExistentialProjection<I>
where I: Interner,

Source§

### impl<I> Relate<I> for ExistentialTraitRef<I>
where I: Interner,

Source§

### impl<I> Relate<I> for FnSig<I>
where I: Interner,

Source§

### impl<I> Relate<I> for TraitPredicate<I>
where I: Interner,

Source§

### impl<I> Relate<I> for TraitRef<I>
where I: Interner,

Source§

### impl<I, T> Relate<I> for Binder<I, T>
where I: Interner, T: Relate<I>,