Merge pull request #115 from nikomatsakis/move-unwind-safe-impls

move the RefUnwindSafe impls to shared/local state structs
This commit is contained in:
Niko Matsakis 2019-01-21 11:16:17 -05:00 committed by GitHub
commit 3e81f12dd2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View file

@ -37,13 +37,6 @@ pub struct Runtime<DB: Database> {
shared_state: Arc<SharedState<DB>>,
}
impl<DB> std::panic::RefUnwindSafe for Runtime<DB>
where
DB: Database,
DB::DatabaseStorage: std::panic::RefUnwindSafe,
{
}
impl<DB> Default for Runtime<DB>
where
DB: Database,
@ -446,6 +439,13 @@ struct SharedState<DB: Database> {
dependency_graph: Mutex<DependencyGraph<DB>>,
}
impl<DB> std::panic::RefUnwindSafe for SharedState<DB>
where
DB: Database,
DB::DatabaseStorage: std::panic::RefUnwindSafe,
{
}
impl<DB: Database> Default for SharedState<DB> {
fn default() -> Self {
SharedState {

View file

@ -80,6 +80,8 @@ impl<DB: Database> LocalState<DB> {
}
}
impl<DB> std::panic::RefUnwindSafe for LocalState<DB> 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