Description
As explained in the Rust User forum, I noticed that the following impls are not available:
impl<'a, E: Error + Send + 'a> From<E> for Box<dyn Error + Send + 'a> {}
impl<'a, E: Error + Sync + 'a> From<E> for Box<dyn Error + Sync + 'a> {}
The first one is pretty useful when working with rayon and errors, which only need to be Send
to be passed across threads. In theory, a stateful error with a Cell
or a RefCell
is a possible example of dyn Error + Send + !Sync
.
The second impl is mainly for coherence and symmetry, I still do not have in mind a possible realistic situation.
In any case, IMHO this feature should not require a RFC. In that case I can create a PR and follow these steps:
- Implement the two impls
- Adjust the docs
It is the first time I contribute to Rust, and I am not sure if this feature should require a stabilization process. In this case just let me know, and I will update this document in order to include the addition of a feature gate and everything needed.
Any feedback is appreciated to make me do things nicely and your review less painful.