Oh yea you need a concrete impl don't you, I forgot the From<T> doesn't work as a coersion site for dyn Error.
-
-
Either way, you can't meaningfully get what
@klaehnr wants which is presumably a catch all error type via Arc that itself impls Error. Side question, Sian do you know if specialization is planned to allow overlap?2 replies 0 retweets 0 likes -
You definitely could write `impl<E: Error + ?Sized> Error for Arc<E>`.There's nothing incoherent about it.
1 reply 0 retweets 1 like -
Yaah 🦀 Retweeted Yaah 🦀
Yaah 🦀 added,
1 reply 0 retweets 0 likes -
The `Sized` bound doesn't need to be there
1 reply 0 retweets 1 like -
Or rather could be `?Sized`
2 replies 0 retweets 0 likes -
But it will match `dyn Error`, resulting in same conflict again.
1 reply 0 retweets 1 like -
-
Ingvar Stepanyan Retweeted Yaah 🦀
Ingvar Stepanyan added,
Yaah 🦀 @yaahc_Replying to @klaehnr @rustlangArc<dyn Error> and Box<dyn Error> cannot impl Error due to the overlap rule which says currently in rust you cannot have two generic trait impls both be valid for the same type. From<T> for Arc<T> and From<T> for T would overlap if Arc<dyn Error> itself could coerce to dyn Error1 reply 0 retweets 1 like -
Replying to @RReverser @yaahc_ and
Those don't overlap and wouldn't ever though. The issue with Box is `impl<E: Error + ?Sized> From<E> for Box<dyn Error>`. There is no such impl for Arc. https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=36eb504e655f8b8a8bf9ffa80fee98cb …
2 replies 0 retweets 1 like
Being able to coerce to `dyn Trait` doesn't make your type the same as `dyn Trait`. Even if they did, this would never cause `From` to overlap since `From` requires sized on both the type parameter and the implementor
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.