-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 comparing values in const
items
#92391
Comments
One interesting thing to note is that you can currently use all of those primitive types as fields inside structs, implement However, I'm assuming this probably has something to do with the compiler likely just "special casing" primitive types in various scenarios without actually taking the trait system directly into account at all (which it seems as though it'd have to have done historically in order to avoid all sorts of runtime performance isssues popping up). |
Any reason why I used |
@raldone01 No reason. Feel free to add that yourself :) |
…dering, r=fee1-dead Constify `PartialEq` for `Ordering` Adds `impl const PartialEq for Ordering {}` to rust-lang#92391.
This comment was marked as resolved.
This comment was marked as resolved.
…e1-dead Constify cmp_min_max_by. Constifies `core::cmp::{min, max}_by[_key]` behind the `const_cmp` rust-lang#92391 feature gate, using `const_closure`.
@fee1-dead could this, or at least a subset, be moved to const stable at this point? I'm not sure if it's blocked on const traits, but the functions seem fairly uncontroversial |
No we are currently planning temporary removal of all things related to const traits in the standard library to allow a clean redesign of compiler implementation of const traits. Unless there's a way to make sure that it would remain stable even if we remove const traits entirely we can't stabilize anything that uses const traits. Also do note that const traits don't have an accepted RFC yet and is still experimental. |
As of 2023-04-20, rust version 1.71.0-nightly (39c6804 2023-04-19), I've just found that this has been removed. Is there an alternative way of doing const cmp? |
This has been removed by #110393. |
Feature gate:
#![feature(const_cmp)]
This is a tracking issue for various
const
PartialEq
,PartialOrd
,Ord
impls in the standard libraryPublic API
Steps / History
(Partial)Ord
impls #92390 ConstifyPartialEq
forOrdering
#101810 Constify cmp_min_max_by. #102245Unresolved Questions
The text was updated successfully, but these errors were encountered: