about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-11-27 21:27:37 +0000
committerMichael Goulet <michael@errs.io>2024-12-02 22:51:18 +0000
commit398fd901d5f8afa982eeb0f9318d9d0e4e791f44 (patch)
treec5e61541e52b9d517b382b85e14d3a441db6993e /compiler/rustc_data_structures/src
parentabfa5c1dca4c549f0e196a872579434ff23a24bb (diff)
downloadrust-398fd901d5f8afa982eeb0f9318d9d0e4e791f44.tar.gz
rust-398fd901d5f8afa982eeb0f9318d9d0e4e791f44.zip
Assert that obligations are empty before deeply normalizing
Diffstat (limited to 'compiler/rustc_data_structures/src')
-rw-r--r--compiler/rustc_data_structures/src/obligation_forest/mod.rs4
1 files changed, 4 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 34a2464972a..78d69a66edc 100644
--- a/compiler/rustc_data_structures/src/obligation_forest/mod.rs
+++ b/compiler/rustc_data_structures/src/obligation_forest/mod.rs
@@ -415,6 +415,10 @@ impl<O: ForestObligation> ObligationForest<O> {
             .collect()
     }
 
+    pub fn has_pending_obligations(&self) -> bool {
+        self.nodes.iter().any(|node| node.state.get() == NodeState::Pending)
+    }
+
     fn insert_into_error_cache(&mut self, index: usize) {
         let node = &self.nodes[index];
         self.error_cache