-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Constify a few (Partial)Ord
impls
#92390
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
(Partial)Ord
impls(Partial)Ord
impls
We have to be very careful here -- floating point operations in const are unstable, but impls are insta-stable. We need to make sure that we do not accidentally allow stable code to perform floating point comparisons when |
Just updated the description on the tracking issue. |
r? @oli-obk |
☔ The latest upstream changes (presumably #94787) made this pull request unmergeable. Please resolve the merge conflicts. |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
This comment has been minimized.
This comment has been minimized.
@bors r+ |
Constify a few `(Partial)Ord` impls Only a few `impl`s are constified for now, as rust-lang#92257 has not landed in the bootstrap compiler yet and quite a few impls would need that fix. This unblocks rust-lang#92228, which unblocks marking iterator methods as `default_method_body_is_const`.
Rollup of 9 pull requests Successful merges: - rust-lang#92390 (Constify a few `(Partial)Ord` impls) - rust-lang#97077 (Simplify some code that depend on Deref) - rust-lang#98710 (correct the output of a `capacity` method example) - rust-lang#99084 (clarify how write_bytes can lead to UB due to invalid values) - rust-lang#99178 (Lighten up const_prop_lint, reusing const_prop) - rust-lang#99673 (don't ICE on invalid dyn calls) - rust-lang#99703 (Expose size_hint() for TokenStream's iterator) - rust-lang#99709 (`Inherited` always has `TypeckResults` available) - rust-lang#99713 (Fix sidebar background) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This small improvement allows to write many more const functions :) |
Is #![feature(const_cmp)] needed to compile? |
`[ref:int_const_ord]` has been resolved by [rust-lang/rust#92390][1]. [1]: rust-lang/rust#92390
Only a few
impl
s are constified for now, as #92257 has not landed in the bootstrap compiler yet and quite a few impls would need that fix.This unblocks #92228, which unblocks marking iterator methods as
default_method_body_is_const
.