-
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 const_float_methods
#133389
Stabilize const_float_methods
#133389
Conversation
Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter cc @rust-lang/miri, @rust-lang/wg-const-eval |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cc @rust-lang/wg-const-eval
bootstrap, | ||
rustc_const_stable(feature = "const_float_methods", since = "CURRENT_RUSTC_VERSION") | ||
)] | ||
#[cfg_attr(not(bootstrap), rustc_intrinsic_const_stable_indirect)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These intrinsics have been approved by t-lang FCP here.
d7ed2d6
to
6f7dc38
Compare
Looks good, thanks. :) @bors r+ rollup |
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#133300 (inject_panic_runtime(): Avoid double negation for 'any non rlib') - rust-lang#133301 (Add code example for `wrapping_neg` method for signed integers) - rust-lang#133371 (remove is_trivially_const_drop) - rust-lang#133389 (Stabilize `const_float_methods`) - rust-lang#133398 (rustdoc: do not call to_string, it's already impl Display) - rust-lang#133405 (tidy: Distinguish between two different meanings of "style file") r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#133389 - eduardosm:stabilize-const_float_methods, r=RalfJung Stabilize `const_float_methods` Tracking issue: rust-lang#130843 Relnotes: rust-lang#133383 Stabilized const API: ```rust // in `core` impl f32/f64 { pub const fn recip(self) -> Self; pub const fn to_degrees(self) -> Self; pub const fn to_radians(self) -> Self; pub const fn max(self, other: Self) -> Self; pub const fn min(self, other: Self) -> Self; pub const fn clamp(self, min: Self, max: Self) -> Self; pub const fn abs(self) -> Self; pub const fn signum(self) -> Self; pub const fn copysign(self, sign: Self) -> Self; } ``` Closes rust-lang#130843 r? libs-api cc `@RalfJung` -- I think the way const-stability attributes work have change a bit since the last time a wrote a const-stabilization PR, please make sure I got them right.
Tracking issue: #130843
Relnotes: #133383
Stabilized const API:
Closes #130843
r? libs-api
cc @RalfJung -- I think the way const-stability attributes work have change a bit since the last time a wrote a const-stabilization PR, please make sure I got them right.