impl Into<T> for Infallible where T: Error #233
Labels
ACP-accepted
API Change Proposal is accepted (seconded with no objections)
api-change-proposal
A proposal to add or alter unstable APIs in the standard libraries
T-libs-api
Proposal
Problem statement
Infallible should implicitly convert to all other error types.
Motivating examples or use cases
I wrote the following function:
and found it didn't compile until I added this conversion:
Solution sketch
Alternatives
Alternatives would include:
unwrap()
that would only unwrapInfallible
.Try
interfaces, such asimpl From<U> for T where T: TryFrom<U,Error=Infallible>
, but this would mean adding code in a lot of places rather than only one.What happens now?
This issue is part of the libs-api team API change proposal process. Once this issue is filed the libs-api team will review open proposals as capability becomes available. Current response times do not have a clear estimate, but may be up to several months.
Possible responses
The libs team may respond in various different ways. First, the team will consider the problem (this doesn't require any concrete solution or alternatives to have been proposed):
Second, if there's a concrete solution:
The text was updated successfully, but these errors were encountered: