From 877d3f20d13ea1ed2f423b653c0e347c9d48ea1b Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Tue, 18 May 2021 15:17:53 +0200 Subject: [PATCH] Remove `on_propagated_panic` --- src/derived/slot.rs | 9 ++++++--- src/lib.rs | 6 ------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/derived/slot.rs b/src/derived/slot.rs index c7c92778..00df8101 100644 --- a/src/derived/slot.rs +++ b/src/derived/slot.rs @@ -1,4 +1,3 @@ -use crate::blocking_future::{BlockingFuture, Promise}; use crate::debug::TableEntry; use crate::derived::MemoizationPolicy; use crate::durability::Durability; @@ -10,6 +9,10 @@ use crate::revision::Revision; use crate::runtime::Runtime; use crate::runtime::RuntimeId; use crate::runtime::StampedValue; +use crate::{ + blocking_future::{BlockingFuture, Promise}, + Canceled, +}; use crate::{ CycleError, Database, DatabaseKeyIndex, DiscardIf, DiscardWhat, Event, EventKind, QueryDb, SweepStrategy, @@ -353,7 +356,7 @@ where }, }); - let result = future.wait().unwrap_or_else(|| db.on_propagated_panic()); + let result = future.wait().unwrap_or_else(|| Canceled::throw()); ProbeState::UpToDate(if result.cycle.is_empty() { Ok(result.value) } else { @@ -576,7 +579,7 @@ where // Release our lock on `self.state`, so other thread can complete. std::mem::drop(state); - let result = future.wait().unwrap_or_else(|| db.on_propagated_panic()); + let result = future.wait().unwrap_or_else(|| Canceled::throw()); return !result.cycle.is_empty() || result.value.changed_at > revision; } diff --git a/src/lib.rs b/src/lib.rs index 39ab7246..70f5f2ba 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -74,12 +74,6 @@ pub trait Database: plumbing::DatabaseOps { #![allow(unused_variables)] } - /// This function is invoked when a dependent query is being computed by the - /// other thread, and that thread panics. - fn on_propagated_panic(&self) -> ! { - Canceled::throw() - } - /// Gives access to the underlying salsa runtime. fn salsa_runtime(&self) -> &Runtime { self.ops_salsa_runtime()