From 90f63e34e9ab2546ddfd4a265505cb5f92f0258b Mon Sep 17 00:00:00 2001 From: Andreas Fackler Date: Thu, 11 Oct 2018 10:48:32 +0200 Subject: [PATCH] Remove explicit Send+Sync impl for Error. --- src/error.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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); + } +}