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

Added into_value function to ControlFlow<T, T> #137495

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

madhav-madhusoodanan
Copy link

@madhav-madhusoodanan madhav-madhusoodanan commented Feb 23, 2025

Context

Adds a function into_value that enables the value within a ControlFlow<T, T> enum to be extracted.
This is an unstable feature.

cc: #137461
r? @scottmcm @chenyukang

@rustbot
Copy link
Collaborator

rustbot commented Feb 23, 2025

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @scottmcm (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 23, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@jhpratt
Copy link
Member

jhpratt commented Feb 23, 2025

Thanks!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Feb 23, 2025

📌 Commit 0216ce3 has been approved by jhpratt

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 23, 2025
@compiler-errors
Copy link
Member

compiler-errors commented Feb 24, 2025

@bors r-

Please squash this into one commit and update the title so it doesn't say "const". In the future, please make sure the commit history isn't so granular if it's not meaningfully/usefully reflected in the final state of the PR.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 24, 2025
@madhav-madhusoodanan madhav-madhusoodanan changed the title Added into_value const function to ControlFlow<T, T> Added into_value function to ControlFlow<T, T> Feb 24, 2025
Fixed issue with usage of generics and moved feature gate to crate root

Removed const tag

Fixed alphabetical ordering of feature gate, added same to doctest

Removed crate-level declaration of feature gate control_flow_into_value

Used const_precise_live_drops to constify into_value without issue of a drop
@madhav-madhusoodanan madhav-madhusoodanan force-pushed the feature-unstable-control-flow-into-value branch from 0216ce3 to f49b6c6 Compare February 24, 2025 02:09
@madhav-madhusoodanan
Copy link
Author

Have changed the function signature back to const fn by using #[rustc_allow_const_fn_unstable(const_precise_live_drops)] feature, as suggested by @compiler-errors .

Have also squashed the PR into a single commit. Will keep in mind to take particular care of the commit history of future PRs.

Please let me know if this PR look good.

@rustbot review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 24, 2025
@jhpratt
Copy link
Member

jhpratt commented Feb 24, 2025

@bors r+

@bors
Copy link
Contributor

bors commented Feb 24, 2025

📌 Commit f49b6c6 has been approved by jhpratt

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 24, 2025
jhpratt added a commit to jhpratt/rust that referenced this pull request Feb 24, 2025
…ble-control-flow-into-value, r=jhpratt

Added into_value function to ControlFlow<T, T>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants