diff --git a/src/error.rs b/src/error.rs index fb26b81..3e41566 100644 --- a/src/error.rs +++ b/src/error.rs @@ -11,8 +11,18 @@ pub enum Error { DegreeTooHigh, } -unsafe impl Send for Error {} -unsafe impl Sync for Error {} - /// A crypto result. pub type Result = ::std::result::Result; + +#[cfg(test)] +mod tests { + use super::Error; + + /// No-op function that compiles only if its argument is `Send + Sync`. + fn is_send_and_sync(_: T) {} + + #[test] + fn errors_are_send_and_sync() { + is_send_and_sync(Error::NotEnoughShares); + } +}