diff --git a/src/runtime.rs b/src/runtime.rs index d63ba8c9..a06350bc 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -37,13 +37,6 @@ pub struct Runtime { shared_state: Arc>, } -impl std::panic::RefUnwindSafe for Runtime -where - DB: Database, - DB::DatabaseStorage: std::panic::RefUnwindSafe, -{ -} - impl Default for Runtime where DB: Database, @@ -446,6 +439,13 @@ struct SharedState { dependency_graph: Mutex>, } +impl std::panic::RefUnwindSafe for SharedState +where + DB: Database, + DB::DatabaseStorage: std::panic::RefUnwindSafe, +{ +} + impl Default for SharedState { fn default() -> Self { SharedState { diff --git a/src/runtime/local_state.rs b/src/runtime/local_state.rs index 496d3afc..a3d893d0 100644 --- a/src/runtime/local_state.rs +++ b/src/runtime/local_state.rs @@ -80,6 +80,8 @@ impl LocalState { } } +impl std::panic::RefUnwindSafe for LocalState where DB: Database {} + /// When a query is pushed onto the `active_query` stack, this guard /// is returned to represent its slot. The guard can be used to pop /// the query from the stack -- in the case of unwinding, the guard's