aboutsummaryrefslogtreecommitdiff
path: root/crates/base_db/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-03-29 19:08:07 +0100
committerAleksey Kladov <[email protected]>2021-03-29 19:38:23 +0100
commit483a5bc9c850f3144cfbdf51a272bbcadbdc5934 (patch)
treeecf33d017c79e31a13b082e676a8fdcbebd85267 /crates/base_db/src
parent2381a54c2f6ff1d97b9d6cb982dde5644f09a396 (diff)
internal: track missing `.check_cancelled`
Diffstat (limited to 'crates/base_db/src')
-rw-r--r--crates/base_db/src/lib.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/base_db/src/lib.rs b/crates/base_db/src/lib.rs
index 5f77a0b1f..980a0ed98 100644
--- a/crates/base_db/src/lib.rs
+++ b/crates/base_db/src/lib.rs
@@ -59,6 +59,8 @@ pub trait CheckCanceled {
59 Self: Sized + panic::RefUnwindSafe, 59 Self: Sized + panic::RefUnwindSafe,
60 F: FnOnce(&Self) -> T + panic::UnwindSafe, 60 F: FnOnce(&Self) -> T + panic::UnwindSafe,
61 { 61 {
62 // Uncomment to debug missing cancellations.
63 // let _span = profile::heartbeat_span();
62 panic::catch_unwind(|| f(self)).map_err(|err| match err.downcast::<Canceled>() { 64 panic::catch_unwind(|| f(self)).map_err(|err| match err.downcast::<Canceled>() {
63 Ok(canceled) => *canceled, 65 Ok(canceled) => *canceled,
64 Err(payload) => panic::resume_unwind(payload), 66 Err(payload) => panic::resume_unwind(payload),
@@ -68,6 +70,7 @@ pub trait CheckCanceled {
68 70
69impl<T: salsa::Database> CheckCanceled for T { 71impl<T: salsa::Database> CheckCanceled for T {
70 fn check_canceled(&self) { 72 fn check_canceled(&self) {
73 // profile::heartbeat();
71 if self.salsa_runtime().is_current_revision_canceled() { 74 if self.salsa_runtime().is_current_revision_canceled() {
72 Canceled::throw() 75 Canceled::throw()
73 } 76 }