Skip to content

Commit 749dec6

Browse files
committed
Make OUT an associated type instead of a generic parameter
This avoids toil when changing other functions in `ObligationForest` to take an `OUT` parameter.
1 parent 5922d6c commit 749dec6

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

compiler/rustc_data_structures/src/obligation_forest/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ pub trait ForestObligation: Clone + Debug {
9595
pub trait ObligationProcessor {
9696
type Obligation: ForestObligation;
9797
type Error: Debug;
98+
type OUT: OutcomeTrait<
99+
Obligation = Self::Obligation,
100+
Error = Error<Self::Obligation, Self::Error>,
101+
>;
98102

99103
fn needs_process_obligation(&self, obligation: &Self::Obligation) -> bool;
100104

compiler/rustc_data_structures/src/obligation_forest/tests.rs

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ where
6464
{
6565
type Obligation = O;
6666
type Error = E;
67+
type OUT = TestOutcome<O, E>;
6768

6869
fn needs_process_obligation(&self, _obligation: &Self::Obligation) -> bool {
6970
true

compiler/rustc_trait_selection/src/traits/fulfill.rs

+1
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ fn mk_pending(os: Vec<PredicateObligation<'_>>) -> Vec<PendingPredicateObligatio
224224
impl<'a, 'b, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'b, 'tcx> {
225225
type Obligation = PendingPredicateObligation<'tcx>;
226226
type Error = FulfillmentErrorCode<'tcx>;
227+
type OUT = Outcome<Self::Obligation, Self::Error>;
227228

228229
/// Identifies whether a predicate obligation needs processing.
229230
///

0 commit comments

Comments
 (0)