From f4d3f5a9f994505f8b7eb08f6db27a77dd72670a Mon Sep 17 00:00:00 2001 From: Kevin Reid Date: Wed, 4 Dec 2024 17:06:14 -0800 Subject: [PATCH] listen: Add `AssertUnwindSafe` as a workaround. This fixes the tests under no-default-features (where the `maybe_sync::Mutex` is really a `RefCell`). --- all-is-cubes/src/listen/store.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/all-is-cubes/src/listen/store.rs b/all-is-cubes/src/listen/store.rs index 819cc382b..70a167ace 100644 --- a/all-is-cubes/src/listen/store.rs +++ b/all-is-cubes/src/listen/store.rs @@ -277,10 +277,12 @@ mod tests { let listener = sl.listener(); // Poison the mutex by panicking inside it - let _ = std::panic::catch_unwind(|| { + // TODO: Get rid of this `AssertUnwindSafe` by making `StoreLock` *always* (rather than + // conditionally) `RefUnwindSafe` + let _ = std::panic::catch_unwind(core::panic::AssertUnwindSafe(|| { let _guard = sl.lock(); panic!("poison"); - }); + })); // Listener does not panic, and returns false. assert_eq!(listener.receive(&["foo"]), false);