Make Error: Sync + Send

This commit is contained in:
Sergey Pepyakin 2018-01-23 16:57:09 +03:00
parent 88c25b6361
commit c274459bab
2 changed files with 14 additions and 1 deletions

View File

@ -34,7 +34,7 @@ impl<'a> RuntimeArgs<'a> {
}
/// Custom user error.
pub trait HostError: 'static + ::std::fmt::Display + ::std::fmt::Debug {
pub trait HostError: 'static + ::std::fmt::Display + ::std::fmt::Debug + Send + Sync {
#[doc(hidden)]
fn __private_get_type_id__(&self) -> TypeId {
TypeId::of::<Self>()

View File

@ -1,2 +1,15 @@
mod host;
mod wasm;
use super::Error;
fn assert_send<T: Send>() {}
fn assert_sync<T: Sync>() {}
fn assert_std_err_impl<T: ::std::error::Error>() {}
#[test]
fn assert_error_properties() {
assert_send::<Error>();
assert_sync::<Error>();
assert_std_err_impl::<Error>();
}