I’ll stick a PR in and see what feedback it gets.
Update: I added ?Sized to the bound and got the following error
error[E0119]: conflicting implementations of trait `core::convert::From<alloc_crate::boxed::Box<dyn error::Error>>` for type `alloc_crate::boxed::Box<dyn error::Error>`:
--> src/libstd/error.rs:219:1
|
219 | impl<'a, E: Error + ?Sized + 'a> From<E> for Box<dyn Error + 'a> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: conflicting implementation in crate `core`:
- impl<T> core::convert::From<T> for T;
error[E0119]: conflicting implementations of trait `core::convert::From<alloc_crate::boxed::Box<dyn error::Error + core::marker::Send + core::marker::Sync>>` for type `alloc_crate::boxed::Box<dyn error::Error + core::marker::Send + core::marker::Sync>`:
--> src/libstd/error.rs:255:1
|
255 | impl<'a, E: Error + Send + Sync + ?Sized + 'a> From<E> for Box<dyn Error + Send + Sync + 'a> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: conflicting implementation in crate `core`:
- impl<T> core::convert::From<T> for T;
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0119`.
error: Could not compile `std`.
I think those conversions are unnecessary now since they are covered by the blanket impl. I will try removing them and see if I get errors.
Update 2: This causes failure so the conflict must be between 2 things that are not the same. Is this a rustc bug?
Update 3: I asked about the issue on irlo, but I don’t fully understand the response. Does it mean that the conflicting impls above are redundant? It doesn’t seem so since removing them causes errors elsewhere.