Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impl Error for Infallible #70842

Closed
a1phyr opened this issue Apr 6, 2020 · 1 comment · Fixed by #71633
Closed

Impl Error for Infallible #70842

a1phyr opened this issue Apr 6, 2020 · 1 comment · Fixed by #71633
Labels
A-error-handling Area: Error handling C-enhancement Category: An issue proposing an enhancement or a PR with one. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@a1phyr
Copy link
Contributor

a1phyr commented Apr 6, 2020

Is there a reason why std::convert::Infallible does not implement std::error::Error ? I could not find anything about this, apart from the planned replacement by ! type.

If not, could this be implemented ? It would be very useful for generic code, and would not be complex as Infallible already implements Debug and Display.

@jonas-schievink jonas-schievink added A-error-handling Area: Error handling C-enhancement Category: An issue proposing an enhancement or a PR with one. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Apr 6, 2020
@a1phyr
Copy link
Contributor Author

a1phyr commented Apr 7, 2020

Actually Error is implemented for std::string::ParseError, which is an alias to Infallible. It seems a bit weird for it to be done this way, shouldn't we move the impl to Infallible ?

JohnTitor added a commit to JohnTitor/rust that referenced this issue May 28, 2020
Impl Error for Infallible

This PR only changes the place where `impl Error for Infallible` is documented, as one could think that it is not the case when reading https://doc.rust-lang.org/nightly/std/convert/enum.Infallible.html.

Fixes rust-lang#70842
@bors bors closed this as completed in a08a03c May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-error-handling Area: Error handling C-enhancement Category: An issue proposing an enhancement or a PR with one. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants