From 749dec64519b5bdfe688cb945eeee5afd6ab68d0 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Mon, 19 Sep 2022 20:57:37 -0500 Subject: Make `OUT` an associated type instead of a generic parameter This avoids toil when changing other functions in `ObligationForest` to take an `OUT` parameter. --- compiler/rustc_data_structures/src/obligation_forest/mod.rs | 4 ++++ compiler/rustc_data_structures/src/obligation_forest/tests.rs | 1 + 2 files changed, 5 insertions(+) (limited to 'compiler/rustc_data_structures') diff --git a/compiler/rustc_data_structures/src/obligation_forest/mod.rs b/compiler/rustc_data_structures/src/obligation_forest/mod.rs index e351b650a16..f2d72647a66 100644 --- a/compiler/rustc_data_structures/src/obligation_forest/mod.rs +++ b/compiler/rustc_data_structures/src/obligation_forest/mod.rs @@ -95,6 +95,10 @@ pub trait ForestObligation: Clone + Debug { pub trait ObligationProcessor { type Obligation: ForestObligation; type Error: Debug; + type OUT: OutcomeTrait< + Obligation = Self::Obligation, + Error = Error, + >; fn needs_process_obligation(&self, obligation: &Self::Obligation) -> bool; diff --git a/compiler/rustc_data_structures/src/obligation_forest/tests.rs b/compiler/rustc_data_structures/src/obligation_forest/tests.rs index e2991aae174..f2a04796691 100644 --- a/compiler/rustc_data_structures/src/obligation_forest/tests.rs +++ b/compiler/rustc_data_structures/src/obligation_forest/tests.rs @@ -64,6 +64,7 @@ where { type Obligation = O; type Error = E; + type OUT = TestOutcome; fn needs_process_obligation(&self, _obligation: &Self::Obligation) -> bool { true -- cgit 1.4.1-3-g733a5