mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-04 19:29:07 +00:00
Make OUT
an associated type instead of a generic parameter
This avoids toil when changing other functions in `ObligationForest` to take an `OUT` parameter.
This commit is contained in:
parent
5922d6cf60
commit
749dec6451
@ -95,6 +95,10 @@ pub trait ForestObligation: Clone + Debug {
|
|||||||
pub trait ObligationProcessor {
|
pub trait ObligationProcessor {
|
||||||
type Obligation: ForestObligation;
|
type Obligation: ForestObligation;
|
||||||
type Error: Debug;
|
type Error: Debug;
|
||||||
|
type OUT: OutcomeTrait<
|
||||||
|
Obligation = Self::Obligation,
|
||||||
|
Error = Error<Self::Obligation, Self::Error>,
|
||||||
|
>;
|
||||||
|
|
||||||
fn needs_process_obligation(&self, obligation: &Self::Obligation) -> bool;
|
fn needs_process_obligation(&self, obligation: &Self::Obligation) -> bool;
|
||||||
|
|
||||||
|
@ -64,6 +64,7 @@ where
|
|||||||
{
|
{
|
||||||
type Obligation = O;
|
type Obligation = O;
|
||||||
type Error = E;
|
type Error = E;
|
||||||
|
type OUT = TestOutcome<O, E>;
|
||||||
|
|
||||||
fn needs_process_obligation(&self, _obligation: &Self::Obligation) -> bool {
|
fn needs_process_obligation(&self, _obligation: &Self::Obligation) -> bool {
|
||||||
true
|
true
|
||||||
|
@ -224,6 +224,7 @@ fn mk_pending(os: Vec<PredicateObligation<'_>>) -> Vec<PendingPredicateObligatio
|
|||||||
impl<'a, 'b, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'b, 'tcx> {
|
impl<'a, 'b, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'b, 'tcx> {
|
||||||
type Obligation = PendingPredicateObligation<'tcx>;
|
type Obligation = PendingPredicateObligation<'tcx>;
|
||||||
type Error = FulfillmentErrorCode<'tcx>;
|
type Error = FulfillmentErrorCode<'tcx>;
|
||||||
|
type OUT = Outcome<Self::Obligation, Self::Error>;
|
||||||
|
|
||||||
/// Identifies whether a predicate obligation needs processing.
|
/// Identifies whether a predicate obligation needs processing.
|
||||||
///
|
///
|
||||||
|
Loading…
Reference in New Issue
Block a user