-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Stabilize ControlFlow::{BREAK, CONTINUE}
#102697
Stabilize ControlFlow::{BREAK, CONTINUE}
#102697
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
I flipped a coin between libs-api reviewers and got |
These feel a bit odd to me. I agree |
@m-ou-se I had the same reaction. I would lean against adding these. |
Personally I wouldn't be comfortable directly using them, unless they're part of the prelude. This looks like a feature too niche to just import directly. But if one uses them via the qualified name |
Hi libs-api! This has been in limbo for a while, so I'm nominating to get a quorum input on what I should do with it. Please either:
(Or if there's some other process you'd like me to follow, let me know.) |
Team member @joshtriplett has proposed to close this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
Stop using `BREAK` & `CONTINUE` in compiler Switching them to `Break(())` and `Continue(())` instead. Entirely search-and-replace, though there's one spot where rustfmt insisted on a reformatting too. libs-api would like to remove these constants (rust-lang#102697 (comment)), so stop using them in compiler to make the removal PR later smaller.
Stop using `BREAK` & `CONTINUE` in compiler Switching them to `Break(())` and `Continue(())` instead. Entirely search-and-replace, though there's one spot where rustfmt insisted on a reformatting too. libs-api would like to remove these constants (rust-lang#102697 (comment)), so stop using them in compiler to make the removal PR later smaller.
The final comment period, with a disposition to close, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. |
Libs-API decided to remove these in rust-lang#102697. Follow-up to rust-lang#107023, which removed them from `compiler/`, but a couple new ones showed up since that was merged.
Remove `ControlFlow::{BREAK, CONTINUE}` Libs-API decided to remove these in rust-lang#102697. Follow-up to rust-lang#107023, which removed them from `compiler/`, but a couple new ones showed up since that was merged. r? libs
Remove `ControlFlow::{BREAK, CONTINUE}` Libs-API decided to remove these in rust-lang#102697. Follow-up to rust-lang#107023, which removed them from `compiler/`, but a couple new ones showed up since that was merged. r? libs
I don't think these ever had any libs-api oversight, but they're super-simple so I figured I'd just send this PR to prompt discussion.
I wasn't confident in them when I first added them (#76318 (comment)), but they've been extensively used in the compiler, and #75744 (comment) got posted in their favour. So that makes me think they're worth having. Here's a few examples:
rust/compiler/rustc_middle/src/ty/visit.rs
Lines 645 to 649 in d8613f7
rust/compiler/rustc_middle/src/ty/sty.rs
Lines 1897 to 1899 in d8613f7
rust/compiler/rustc_data_structures/src/graph/iterate/mod.rs
Lines 347 to 352 in d8613f7
I think that
ControlFlow::CONTINUE
is particularly justified because theC
ontinue generic parameter is defaulted to()
. And if that constant exists, I think there might as well beBREAK
to go with it. It's useful too, for any situation in which you're replacingbool
withControlFlow<()>
in chain-of-responsibility style code, or similar.@rustbot label +needs-fcp +T-libs-api -T-libs
cc the tracking issue #75744, though this is only a partial stabilization so this does not close that.