pub trait ObligationEmittingRelation<'tcx>: TypeRelation<'tcx> {
// Required methods
fn param_env(&self) -> ParamEnv<'tcx>;
fn register_obligations(
&mut self,
obligations: Vec<Obligation<'tcx, Predicate<'tcx>>>
);
fn register_predicates(
&mut self,
obligations: impl IntoIterator- >
)
where <impl IntoIterator as IntoIterator>::Item: ToPredicate<'tcx>;
fn alias_relate_direction(&self) -> AliasRelationDirection;
// Provided method
fn register_type_relate_obligation(&mut self, a: Ty<'tcx>, b: Ty<'tcx>) { ... }
}
Required Methods§
fn param_env(&self) -> ParamEnv<'tcx>
sourcefn register_obligations(
&mut self,
obligations: Vec<Obligation<'tcx, Predicate<'tcx>>>
)
fn register_obligations( &mut self, obligations: Vec<Obligation<'tcx, Predicate<'tcx>>> )
Register obligations that must hold in order for this relation to hold
sourcefn register_predicates(
&mut self,
obligations: impl IntoIterator- >
)
fn register_predicates(
&mut self,
obligations: impl IntoIterator- >
)
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 obligation causes is required.
sourcefn alias_relate_direction(&self) -> AliasRelationDirection
fn alias_relate_direction(&self) -> AliasRelationDirection
Relation direction emitted for AliasRelate predicates, corresponding to the direction
of the relation.
Provided Methods§
sourcefn register_type_relate_obligation(&mut self, a: Ty<'tcx>, b: Ty<'tcx>)
fn register_type_relate_obligation(&mut self, a: Ty<'tcx>, b: Ty<'tcx>)
Register an obligation that both types must be related to each other according to
the ty::AliasRelationDirection given by ObligationEmittingRelation::alias_relate_direction
Object Safety§
This trait is not object safe.