pub trait ObligationEmittingRelation<'tcx>: TypeRelation<'tcx> {
// Required methods
fn register_obligations(
&mut self,
obligations: Vec<Obligation<'tcx, Predicate<'tcx>>, Global>
);
fn register_predicates(
&mut self,
obligations: impl IntoIterator- >
)
where <impl IntoIterator as IntoIterator>::Item: ToPredicate<'tcx, Predicate<'tcx>>;
// Provided methods
fn register_const_equate_obligation(
&mut self,
a: Const<'tcx>,
b: Const<'tcx>
) { ... }
fn register_type_equate_obligation(&mut self, a: Ty<'tcx>, b: Ty<'tcx>) { ... }
}
Required Methods§
sourcefn register_obligations(
&mut self,
obligations: Vec<Obligation<'tcx, Predicate<'tcx>>, Global>
)
fn register_obligations( &mut self, obligations: Vec<Obligation<'tcx, Predicate<'tcx>>, Global> )
Register obligations that must hold in order for this relation to hold
sourcefn register_predicates(
&mut self,
obligations: impl IntoIterator- >
)where
<impl IntoIterator as IntoIterator>::Item: ToPredicate<'tcx, Predicate<'tcx>>,
fn register_predicates(
&mut self,
obligations: impl IntoIterator- >
)where
<impl IntoIterator as IntoIterator>::Item: ToPredicate<'tcx, Predicate<'tcx>>,
Register predicates that must hold in order for this relation to hold. Uses
a default obligation cause, ObligationEmittingRelation::register_obligations should
be used if control over the obligaton causes is required.
Provided Methods§
sourcefn register_const_equate_obligation(&mut self, a: Const<'tcx>, b: Const<'tcx>)
fn register_const_equate_obligation(&mut self, a: Const<'tcx>, b: Const<'tcx>)
Register an obligation that both constants must be equal to each other.
If they aren’t equal then the relation doesn’t hold.
sourcefn register_type_equate_obligation(&mut self, a: Ty<'tcx>, b: Ty<'tcx>)
fn register_type_equate_obligation(&mut self, a: Ty<'tcx>, b: Ty<'tcx>)
Register an obligation that both types must be equal to each other.
If they aren’t equal then the relation doesn’t hold.