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

Tracking Issue for ops::Yeet (feature(try_trait_v2_yeet)) #96374

Open
4 tasks
scottmcm opened this issue Apr 25, 2022 · 1 comment
Open
4 tasks

Tracking Issue for ops::Yeet (feature(try_trait_v2_yeet)) #96374

scottmcm opened this issue Apr 25, 2022 · 1 comment
Labels
C-tracking-issue T-libs-api

Comments

@scottmcm
Copy link
Member

@scottmcm scottmcm commented Apr 25, 2022

Feature gate: #![feature(try_trait_v2_yeet)]

This is a tracking issue for standard library additions related to #96373, which for now means the ops::Yeet struct and related impls.

It currently exists experimentally and likely needs an RFC before stabilization -- at the very least it will not stabilize under the name Yeet. Please try this out and give experience reports, but be aware that it may well change drastically or be removed entirely.

Public API

// core::ops
pub struct Yeet<E>(pub E);

impl<T> ops::FromResidual<ops::Yeet<()>> for Option<T>;
impl<T, E, F: From<E>> ops::FromResidual<ops::Yeet<E>> for Result<T, F>;

Steps / History

  • Implementation: #96376
  • Final comment period (FCP)
  • Stabilization PR

Unresolved Questions

  • The name, of course.
@scottmcm scottmcm added T-libs-api C-tracking-issue labels Apr 25, 2022
bors added a commit to rust-lang-ci/rust that referenced this issue Apr 27, 2022
Add `do yeet` expressions to allow experimentation in nightly

Two main goals for this:
- Ensure that trait restructuring in rust-lang#84277 (comment) doesn't accidentally close us off from the possibility of doing this in future, as sketched in https://rust-lang.github.io/rfcs/3058-try-trait-v2.html#possibilities-for-yeet
- Experiment with the *existence* of syntax for this, to be able to weight the syntax-vs-library tradeoffs better than we can right now.  Notably the syntax (with `do`) and name in this PR are not intended as candidates for stabilization, but they make a good v0 PR for adding this with minimal impact to compiler maintenance or priming one possible name choice over another.

r? `@oli-obk`
The lang `second` for doing this: rust-lang/lang-team#160 (comment)

Tracking issues
- Lang, rust-lang#96373
- Libs-api, rust-lang#96374
bors added a commit to rust-lang-ci/rust that referenced this issue May 1, 2022
Add `do yeet` expressions to allow experimentation in nightly

Two main goals for this:
- Ensure that trait restructuring in rust-lang#84277 (comment) doesn't accidentally close us off from the possibility of doing this in future, as sketched in https://rust-lang.github.io/rfcs/3058-try-trait-v2.html#possibilities-for-yeet
- Experiment with the *existence* of syntax for this, to be able to weight the syntax-vs-library tradeoffs better than we can right now.  Notably the syntax (with `do`) and name in this PR are not intended as candidates for stabilization, but they make a good v0 PR for adding this with minimal impact to compiler maintenance or priming one possible name choice over another.

r? `@oli-obk`
The lang `second` for doing this: rust-lang/lang-team#160 (comment)

Tracking issues
- Lang, rust-lang#96373
- Libs-api, rust-lang#96374
@pro465

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue T-libs-api
Projects
None yet
Development

No branches or pull requests

2 participants