use std::sync::LockResult; pub(crate) trait LockResultExt { fn panic_if_poisoned(self) -> T; } impl LockResultExt for LockResult { #[track_caller] fn panic_if_poisoned(self) -> T { match self { Ok(inner) => inner, Err(err) => panic!("lock poisoned by panic: {err}"), } } }