Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/next_solver/infer/snapshot/mod.rs')
-rw-r--r--crates/hir-ty/src/next_solver/infer/snapshot/mod.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/crates/hir-ty/src/next_solver/infer/snapshot/mod.rs b/crates/hir-ty/src/next_solver/infer/snapshot/mod.rs
index 7b9ca96c51..705aa43fb1 100644
--- a/crates/hir-ty/src/next_solver/infer/snapshot/mod.rs
+++ b/crates/hir-ty/src/next_solver/infer/snapshot/mod.rs
@@ -109,4 +109,17 @@ impl<'db> InferCtxt<'db> {
self.rollback_to(snapshot);
r
}
+
+ /// Scan the constraints produced since `snapshot` and check whether
+ /// we added any region constraints.
+ pub fn region_constraints_added_in_snapshot(&self, snapshot: &CombinedSnapshot) -> bool {
+ self.inner
+ .borrow_mut()
+ .unwrap_region_constraints()
+ .region_constraints_added_in_snapshot(&snapshot.undo_snapshot)
+ }
+
+ pub fn opaque_types_added_in_snapshot(&self, snapshot: &CombinedSnapshot) -> bool {
+ self.inner.borrow().undo_log.opaque_types_in_snapshot(&snapshot.undo_snapshot)
+ }
}