diff --git a/src/runtime.rs b/src/runtime.rs index 5eeb701a..04d7fc19 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -35,6 +35,8 @@ pub struct Runtime { shared_state: Arc>, } +impl std::panic::RefUnwindSafe for Runtime where DB: Database {} + impl Default for Runtime where DB: Database, diff --git a/tests/panic_safely.rs b/tests/panic_safely.rs index 132c0546..c06b59c4 100644 --- a/tests/panic_safely.rs +++ b/tests/panic_safely.rs @@ -63,3 +63,9 @@ fn should_panic_safely() { let result = panic::catch_unwind(AssertUnwindSafe(|| db.panic_safely())); assert!(result.is_ok()) } + +#[test] +fn storages_are_unwind_safe() { + fn check_unwind_safe() {} + check_unwind_safe::<&DatabaseStruct>(); +}