You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.
Hi,
I use Failure::Error in my code, and when I try to use try! on a function that returns an error from the error_chain! macro by the error-chain crate it fails with the following error:
error[E0277]: `(dyn std::error::Error + std::marker::Send + 'static)` cannot be shared between threads safely
--> w3utils.rs:61:19
|
61 | return Ok(ethabi::Contract::load(rdr)?);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn std::error::Error + std::marker::Send + 'static)` cannot be shared between threads safely
|
= help: the trait `std::marker::Sync` is not implemented for `(dyn std::error::Error + std::marker::Send + 'static)`
= note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<(dyn std::error::Error + std::marker::Send + 'static)>`
= note: required because it appears within the type `std::boxed::Box<(dyn std::error::Error + std::marker::Send + 'static)>`
= note: required because it appears within the type `std::option::Option<std::boxed::Box<(dyn std::error::Error + std::marker::Send + 'static)>>`
= note: required because it appears within the type `error_chain::State`
= note: required because it appears within the type `ethabi::Error`
= note: required because of the requirements on the impl of `failure::Fail` for `ethabi::Error`
= note: required because of the requirements on the impl of `std::convert::From<ethabi::Error>` for `failure::Error`
= note: required by `std::convert::From::from`
Now I found an issue on error-chain asking to add Sync support but it doesn't look like anyone is working on it. ( rust-lang-deprecated/error-chain#240 )
Maybe the solution can be from failure? adding some sort of From trait for the error-chain crate?
I would like to know what you guys think,
Thanks.
The text was updated successfully, but these errors were encountered:
Hi! I have the same problem, and manually doing .map_error(SyncFailure::new) works, but it's not very ergonomic if you have to repeat it several times.
I wonder if there's a better way for integrating with error_chain.
Also, I have the same problem with integrating futures and failure: CallFuture::wait returns Result parametrized by (dyn std::error::Error + std::marker::Send + 'static).
Hi,
I use
Failure::Error
in my code, and when I try to usetry!
on a function that returns an error from theerror_chain!
macro by the error-chain crate it fails with the following error:Now I found an issue on
error-chain
asking to add Sync support but it doesn't look like anyone is working on it. ( rust-lang-deprecated/error-chain#240 )Maybe the solution can be from failure? adding some sort of
From
trait for theerror-chain
crate?I would like to know what you guys think,
Thanks.
The text was updated successfully, but these errors were encountered: