-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Make some Ordering methods const #76198
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
Conversation
Constify the following methods of `core::cmp::Ordering`: - `reverse` - `then` Stabilizes these methods as const under the `const_ordering` feature. Also adds a test for these methods in a const context. Possible because of rust-lang#49146 (Allow `if` and `match` in constants).
(rust_highfive has picked a reviewer for you, use r? to override) |
Thanks. :) |
@rfcbot fcp merge |
Team member @Amanieu 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. |
CC @rust-lang/wg-const-eval |
🔔 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. |
@bors r+ |
📌 Commit 79d563c has been approved by |
Rollup of 10 pull requests Successful merges: - rust-lang#73955 (deny(unsafe_op_in_unsafe_fn) in libstd/process.rs) - rust-lang#75146 (Detect overflow in proc_macro_server subspan) - rust-lang#75304 (Note when a a move/borrow error is caused by a deref coercion) - rust-lang#75749 (Consolidate some duplicate code in the sys modules.) - rust-lang#75882 (Use translated variable for test string) - rust-lang#75886 (Test that bounds checks are elided for [..index] after .position()) - rust-lang#76048 (Initial support for riscv32gc_unknown_linux_gnu) - rust-lang#76198 (Make some Ordering methods const) - rust-lang#76689 (Upgrade to pulldown-cmark 0.8.0) - rust-lang#76763 (Update cargo) Failed merges: r? `@ghost`
Stabilize `Poll::is_ready` and `is_pending` as const Insta-stabilize the methods `is_ready` and `is_pending` of `std::task::Poll` as const, in the same way as [PR#76198](rust-lang#76198). Possible because of the recent stabilization of const control flow. Part of rust-lang#76225.
Stabilize `Poll::is_ready` and `is_pending` as const Insta-stabilize the methods `is_ready` and `is_pending` of `std::task::Poll` as const, in the same way as [PR#76198](rust-lang#76198). Possible because of the recent stabilization of const control flow. Part of rust-lang#76225.
Stabilize `Poll::is_ready` and `is_pending` as const Insta-stabilize the methods `is_ready` and `is_pending` of `std::task::Poll` as const, in the same way as [PR#76198](rust-lang#76198). Possible because of the recent stabilization of const control flow. Part of rust-lang#76225.
Stabilize `Poll::is_ready` and `is_pending` as const Insta-stabilize the methods `is_ready` and `is_pending` of `std::task::Poll` as const, in the same way as [PR#76198](rust-lang#76198). Possible because of the recent stabilization of const control flow. Part of rust-lang#76225.
Stabilize `Poll::is_ready` and `is_pending` as const Insta-stabilize the methods `is_ready` and `is_pending` of `std::task::Poll` as const, in the same way as [PR#76198](rust-lang#76198). Possible because of the recent stabilization of const control flow. Part of rust-lang#76225.
Stabilize `Poll::is_ready` and `is_pending` as const Insta-stabilize the methods `is_ready` and `is_pending` of `std::task::Poll` as const, in the same way as [PR#76198](rust-lang#76198). Possible because of the recent stabilization of const control flow. Part of rust-lang#76225.
Stabilize `IpAddr::is_ipv4` and `is_ipv6` as const Insta-stabilize the methods `is_ipv4` and `is_ipv6` of `std::net::IpAddr` as const, in the same way as [PR#76198](rust-lang#76198). Possible because of the recent stabilization of const control flow. Part of rust-lang#76225 and rust-lang#76205.
Resubmission of PR#75463 as per PR#76172.
Constify the following methods of
core::cmp::Ordering
:reverse
then
Insta-stabilizes these methods as const under the
const_ordering
feature, as their implementation is a trivial match and the recent stabilization of #49146 (Allowif
andmatch
in constants).Note: the
const_ordering
feature has never actually been used as these methods have not been#[rustc_const_unstable]
.Tracking issue: #76113