What I dislike about *all* the dynamic `Error` strategies is that we can't have something that is both `From<E: Error>` and `impl Error` at the same time. ;__________;
-
-
Replying to @seanmonstar
Could you say more about why you want `impl Error`? I find that `impl From<anyhow::Error> for Box<dyn StdError + Send + Sync>` (zero cost) + `impl Deref<Target = dyn StdError + Send + Sync>` (also zero cost) accomplishes the same thing seamlessly in 100% of places I know of.
2 replies 0 retweets 2 likes -
Replying to @davidtolnay @seanmonstar
The former makes `?` work for interop with functions that return `Result<T, Box<dyn StdError>>`. The latter makes anyhow::Error work as a #[source] e.g. within `thiserror`'s derive(Error).
1 reply 0 retweets 1 like
Replying to @davidtolnay @seanmonstar
Neither of those actually require a StdError impl for anyhow::Error, though it's common for people to assume they would.
9:21 PM - 24 Oct 2019
0 replies
0 retweets
0 likes
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.