-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
why havn't implemented Error trait for std::option::NoneError ? #46871
Comments
@kennytm thanks |
It seems to me that if |
Facing the same issue in 2019 :/ |
This becomes a prevalent problem in the trainings I give, when people learn about: |
Can this be prioritised? It would be upsetting if this were to be forgotten, particularly since |
I don't believe this has been forgotten or de-prioritized -- at the very least, based on me re-read of #42327, I get the impression that the general feeling is that the Try trait design is not ready and In particular, these comments are relevant: |
I actually changed my mind on this one. Now that I think about it, it only really makes sense to use |
I agree about the error message. I think one thing we missed in the Try trait design discussion was what the errors for mixing should look like -- right now you get the note about |
I'll note that I think the existence of a |
If But generally, I think I'd like to be able to use |
I don't think should implement
If Option does not implement
|
Should NoneError implement the Error trait? Just a note |
I see the issue that Try for Error is already on stable. |
Note that as of right now, it's absolutely by design that It's also unstable for a reason. We have a meeting planned about redesigning the current I strongly discourage anyone from trying to hack around this restriction. Just use |
@scottmcm Make any progress this year on the issue? You've mentioned "we have a meeting planned", just following up here. |
@Halkcyon Sorry for replying super-late here. The meeting was https://blog.rust-lang.org/inside-rust/2020/04/10/lang-team-design-meetings.html#try-blocks-try-traits-functions-that-try-oh-my, though I'm not able to find minutes from there. But rust-lang/rfcs#3058 merged last week, which explicitly blocks the Edit a while later: the PR I'm working on for RFC 3058 currently gives this error:
Hopefully that will point people in the right direction, and avoid them ever hearing of |
What was the resolution for this? If it was resolved, what version of Rust contains the fix and how do we use it in our projects? Is there a convenient workaround that works before the fix? Forgive my questions, I'm really new to Rust and just trying to get it working. |
The resolution of this is that it's expected that mixing them does not compile. As such, the fix is to call |
Forgot it? Still for other reasons.
The text was updated successfully, but these errors were encountered: