Merge pull request #8 from pepyakin/error-sync-and-send

Make Error: Sync + Send
This commit is contained in:
Nikolay Volf 2018-01-23 19:40:39 +03:00 committed by GitHub
commit 7828d8cc56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -34,7 +34,7 @@ impl<'a> RuntimeArgs<'a> {
} }
/// Custom user error. /// 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)] #[doc(hidden)]
fn __private_get_type_id__(&self) -> TypeId { fn __private_get_type_id__(&self) -> TypeId {
TypeId::of::<Self>() TypeId::of::<Self>()

View File

@ -1,2 +1,15 @@
mod host; mod host;
mod wasm; 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>();
}