-
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
Stabilize Range[Inclusive]::is_empty #75132
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
Since this needs an FCP, picking someone from libs who recently re-tagged the tracking issue: r? @KodrAus |
@rfcbot fcp merge This proposes stabilizing the following API: impl<Idx: PartialOrd<Idx>> Range<Idx> {
pub fn is_empty(&self) -> bool;
}
impl<Idx: PartialOrd<Idx>> RangeInclusive<Idx> {
pub fn is_empty(&self) -> bool;
} |
Team member @KodrAus has proposed to merge 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. |
@SimonSapin @sfackler @withoutboats Friendly ping for this pFCP. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period, with a disposition to merge, 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. The RFC will be merged soon. |
Darn, missed 1.47 by a day, I guess. I've changed the stability attributes to 1.48. |
Heh well we have not yet actually branched beta, that usually happens Tuesdays :) But likely this wouldn't have landed in time anyway... |
@bors r+ |
📌 Commit 78855479830ada08b210a483fdb34d07063d6192 has been approved by |
Doh, I mixed up |
5a877a6
to
d6185f9
Compare
@bors r=dtolnay |
📌 Commit d6185f9 has been approved by |
⌛ Testing commit d6185f9 with merge 7a279b300e1be073511080e53bfc0249716138dc... |
💔 Test failed - checks-actions |
Wow am I having good luck today: @bors retry |
☀️ Test successful - checks-actions, checks-azure |
Re-enable len_zero for ranges now that `is_empty` is stable on them Fixes #5956 Completed stabilization PR: rust-lang/rust#75132 changelog: len_zero: re-enable linting ranges now that range_is_empty is stable
I would like to propose these two simple methods for stabilization:
len_zero
with Range suggests code cannot compile rust-clippy#3807 because they're unstablePartialOrd
, consistently with the stablecontains
method, and are thus more general than iterator-based approaches that needStep
is_empty
plans, as these inherent ones are preferred in name resolutionhttps://doc.rust-lang.org/nightly/std/ops/struct.Range.html#method.is_empty
https://doc.rust-lang.org/nightly/std/ops/struct.RangeInclusive.html#method.is_empty
Closes #48111