Stream: project-error-handling

Topic: Next steps on #75180


view this post on Zulip Charles Lew (Sep 18 2020 at 11:34):

Hello, this is a ping from wg-triage, what's the next steps on this PR?

view this post on Zulip Ashley Mannix (Sep 18 2020 at 11:55):

That PR is: https://github.com/rust-lang/rust/pull/75180

view this post on Zulip Ashley Mannix (Sep 18 2020 at 11:56):

It adds impl<‘a, T: ?Sized + Error> Error for &’a T

view this post on Zulip Ashley Mannix (Sep 18 2020 at 11:57):

There’s a crater run in the PR that shows a handful of error crates regressing

view this post on Zulip Ashley Mannix (Sep 18 2020 at 12:00):

I think the next steps are deciding whether it’s a change we want, to fill one of the gaps that makes impl Error a mostly useless generic bound, and whether we want to do it this way our through some other API

view this post on Zulip Ashley Mannix (Sep 18 2020 at 12:02):

I was hoping to bring it up in one of the group’s meetings 😄

view this post on Zulip Jake Goulding (Sep 18 2020 at 14:05):

If I understand the PR correctly, SNAFU works around this via https://docs.rs/snafu/0.6.8/snafu/trait.AsErrorSource.html

view this post on Zulip Ashley Mannix (Sep 18 2020 at 14:34):

Ah that’s interesting 🤔 Is that so you can have generic impl AsErrorSources that covers both impl Error and dyn Error?

view this post on Zulip Ashley Mannix (Sep 18 2020 at 14:35):

That must be one of the regressions too

view this post on Zulip Jake Goulding (Sep 18 2020 at 14:44):

SNAFU did not appear in the regression list, AFAICT.

view this post on Zulip Jane Lusby (Sep 18 2020 at 15:37):

cool

view this post on Zulip Jane Lusby (Sep 18 2020 at 15:38):

<deleted>

view this post on Zulip Jane Lusby (Sep 18 2020 at 16:09):

@Ashley Mannix im betting this has already been tried and theres a good reason this isnt possible but do you know if it would be possible to use AsRef here?

view this post on Zulip Jane Lusby (Sep 18 2020 at 16:27):

oh wait, no people can probably implement AsRef<dyn Error> for their local types already so that wont work at all


Last updated: Jan 29 2022 at 10:01 UTC