about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src
diff options
context:
space:
mode:
authorJoshua Nelson <jnelson@cloudflare.com>2022-09-19 20:57:37 -0500
committerJoshua Nelson <jnelson@cloudflare.com>2022-09-19 22:14:39 -0500
commit749dec64519b5bdfe688cb945eeee5afd6ab68d0 (patch)
tree82b1406741efd312ccfda0a29fe6236764ae2a5b /compiler/rustc_data_structures/src
parent5922d6cf60169ad0fd792581c9da11bd633533da (diff)
downloadrust-749dec64519b5bdfe688cb945eeee5afd6ab68d0.tar.gz
rust-749dec64519b5bdfe688cb945eeee5afd6ab68d0.zip
Make `OUT` an associated type instead of a generic parameter
This avoids toil when changing other functions in `ObligationForest` to take an `OUT` parameter.
Diffstat (limited to 'compiler/rustc_data_structures/src')
-rw-r--r--compiler/rustc_data_structures/src/obligation_forest/mod.rs4
-rw-r--r--compiler/rustc_data_structures/src/obligation_forest/tests.rs1
2 files changed, 5 insertions, 0 deletions
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<Self::Obligation, Self::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<O, E>;
 
     fn needs_process_obligation(&self, _obligation: &Self::Obligation) -> bool {
         true