rustc_infer::traits::util

Trait Elaboratable

Source
pub trait Elaboratable<I>
where I: Interner,
{ // Required methods fn predicate(&self) -> <I as Interner>::Predicate; fn child(&self, clause: <I as Interner>::Clause) -> Self; fn child_with_derived_cause( &self, clause: <I as Interner>::Clause, span: <I as Interner>::Span, parent_trait_pred: Binder<I, TraitPredicate<I>>, index: usize, ) -> Self; }
Expand description

Describes how to elaborate an obligation into a sub-obligation.

Required Methods§

Source

fn predicate(&self) -> <I as Interner>::Predicate

Source

fn child(&self, clause: <I as Interner>::Clause) -> Self

Source

fn child_with_derived_cause( &self, clause: <I as Interner>::Clause, span: <I as Interner>::Span, parent_trait_pred: Binder<I, TraitPredicate<I>>, index: usize, ) -> Self

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.

Implementations on Foreign Types§

Source§

impl<'tcx> Elaboratable<TyCtxt<'tcx>> for (Clause<'tcx>, Span)

Source§

fn predicate(&self) -> Predicate<'tcx>

Source§

fn child(&self, clause: Clause<'tcx>) -> (Clause<'tcx>, Span)

Source§

fn child_with_derived_cause( &self, clause: Clause<'tcx>, _span: Span, _parent_trait_pred: Binder<TyCtxt<'tcx>, TraitPredicate<TyCtxt<'tcx>>>, _index: usize, ) -> (Clause<'tcx>, Span)

Source§

impl<'tcx> Elaboratable<TyCtxt<'tcx>> for (Predicate<'tcx>, Span)

Source§

fn predicate(&self) -> Predicate<'tcx>

Source§

fn child(&self, clause: Clause<'tcx>) -> (Predicate<'tcx>, Span)

Source§

fn child_with_derived_cause( &self, clause: Clause<'tcx>, _span: Span, _parent_trait_pred: Binder<TyCtxt<'tcx>, TraitPredicate<TyCtxt<'tcx>>>, _index: usize, ) -> (Predicate<'tcx>, Span)

Source§

impl<'tcx> Elaboratable<TyCtxt<'tcx>> for Clause<'tcx>

Source§

fn predicate(&self) -> Predicate<'tcx>

Source§

fn child(&self, clause: Clause<'tcx>) -> Clause<'tcx>

Source§

fn child_with_derived_cause( &self, clause: Clause<'tcx>, _span: Span, _parent_trait_pred: Binder<TyCtxt<'tcx>, TraitPredicate<TyCtxt<'tcx>>>, _index: usize, ) -> Clause<'tcx>

Source§

impl<'tcx> Elaboratable<TyCtxt<'tcx>> for Predicate<'tcx>

Source§

fn predicate(&self) -> Predicate<'tcx>

Source§

fn child(&self, clause: Clause<'tcx>) -> Predicate<'tcx>

Source§

fn child_with_derived_cause( &self, clause: Clause<'tcx>, _span: Span, _parent_trait_pred: Binder<TyCtxt<'tcx>, TraitPredicate<TyCtxt<'tcx>>>, _index: usize, ) -> Predicate<'tcx>

Implementors§

Source§

impl<'tcx> Elaboratable<TyCtxt<'tcx>> for PredicateObligation<'tcx>

For Obligation, a sub-obligation is combined with the current obligation’s param-env and cause code.

Source§

impl<I> Elaboratable<I> for ClauseWithSupertraitSpan<I>
where I: Interner,