Description
Proposal
Summary and problem statement
Getting existing error handling capabilities to stable, and exploring future possibilities to ensure compatibility.
Motivation, use-cases, and solution sketches
This is basically https://rust-lang.github.io/rfcs/0243-trait-based-exception-handling.html -- while ?
is available on stable, the traits behind it are not, try
blocks are not, and there's continued interest (https://areweyeetyet.rs/) in exploring some of the future possibilities it brought up.
There's sortof a defacto initiative going on here -- see the mention in these meeting notes https://github.com/rust-lang/lang-team/blob/master/design-meeting-minutes/2022-03-09-lang-roadmap.md#q-which-active-initiatives-are-missing -- but it seems like it would be helpful to have one to track it explicitly.
Links and related work
Some examples of things that could be included here:
- The TryV2 redesign that happened in try_trait_v2: A new design for the ? desugaring rfcs#3058
- The lang side of further restructuring in that area as is being discussed in Tracking Issue for
try_trait_v2
, A new design for the?
desugaring (RFC#3058) rust#84277 (comment) - Getting
try
blocks to stable, having resolved one major open question in ResolvingOk
-wrapping fortry
blocks rust#70941 but with more annotation questions needing work as discussed in https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/try.20blocks/near/275118361 - Experimentally doing
yeet
expressions to ensure the trait designs being discussed can handle them and gaining unstable experience to see whether the extra syntax pulls its weight over existing macro approaches.- I originally tried this from the compiler side, as Add
yeet
experimentally compiler-team#501, but it appears they'd like more of a lang second first, as "the compiler change seems trivial and well motivated if the language change is ok" (https://rust-lang.zulipchat.com/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/Add.20.60yeet.60.20experimentally.20compiler-team.23501/near/276746889).
- I originally tried this from the compiler side, as Add
Initial people involved
- Owner, if known: @scottmcm
- Liaison: @scottmcm
- Interested: @yaahc & https://github.com/rust-lang/project-error-handling
What happens now?
This issue is part of the lang-team initiative process. Once this issue is filed, a Zulip topic will be opened for discussion, and the lang-team will review open proposals in its weekly triage meetings. You should receive feedback within a week or two.
This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.