Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c008ed5

Browse files
tgross35gitbot
authored and
gitbot
committedMar 6, 2025
Stabilize float_next_up_down
FCP completed at [1]. Closes rust-lang#91399 [1]: rust-lang#91399 (comment)
1 parent cb3fbe1 commit c008ed5

File tree

5 files changed

+8
-17
lines changed

5 files changed

+8
-17
lines changed
 

‎core/src/num/f128.rs

-4
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,6 @@ impl f128 {
504504
///
505505
/// ```rust
506506
/// #![feature(f128)]
507-
/// #![feature(float_next_up_down)]
508507
/// # // FIXME(f16_f128): remove when `eqtf2` is available
509508
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
510509
///
@@ -522,7 +521,6 @@ impl f128 {
522521
/// [`MAX`]: Self::MAX
523522
#[inline]
524523
#[unstable(feature = "f128", issue = "116909")]
525-
// #[unstable(feature = "float_next_up_down", issue = "91399")]
526524
pub const fn next_up(self) -> Self {
527525
// Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing
528526
// denormals to zero. This is in general unsound and unsupported, but here
@@ -558,7 +556,6 @@ impl f128 {
558556
///
559557
/// ```rust
560558
/// #![feature(f128)]
561-
/// #![feature(float_next_up_down)]
562559
/// # // FIXME(f16_f128): remove when `eqtf2` is available
563560
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
564561
///
@@ -576,7 +573,6 @@ impl f128 {
576573
/// [`MAX`]: Self::MAX
577574
#[inline]
578575
#[unstable(feature = "f128", issue = "116909")]
579-
// #[unstable(feature = "float_next_up_down", issue = "91399")]
580576
pub const fn next_down(self) -> Self {
581577
// Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing
582578
// denormals to zero. This is in general unsound and unsupported, but here

‎core/src/num/f16.rs

-4
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,6 @@ impl f16 {
497497
///
498498
/// ```rust
499499
/// #![feature(f16)]
500-
/// #![feature(float_next_up_down)]
501500
/// # // FIXME(f16_f128): ABI issues on MSVC
502501
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
503502
///
@@ -515,7 +514,6 @@ impl f16 {
515514
/// [`MAX`]: Self::MAX
516515
#[inline]
517516
#[unstable(feature = "f16", issue = "116909")]
518-
// #[unstable(feature = "float_next_up_down", issue = "91399")]
519517
pub const fn next_up(self) -> Self {
520518
// Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing
521519
// denormals to zero. This is in general unsound and unsupported, but here
@@ -551,7 +549,6 @@ impl f16 {
551549
///
552550
/// ```rust
553551
/// #![feature(f16)]
554-
/// #![feature(float_next_up_down)]
555552
/// # // FIXME(f16_f128): ABI issues on MSVC
556553
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
557554
///
@@ -569,7 +566,6 @@ impl f16 {
569566
/// [`MAX`]: Self::MAX
570567
#[inline]
571568
#[unstable(feature = "f16", issue = "116909")]
572-
// #[unstable(feature = "float_next_up_down", issue = "91399")]
573569
pub const fn next_down(self) -> Self {
574570
// Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing
575571
// denormals to zero. This is in general unsound and unsupported, but here

‎core/src/num/f32.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,6 @@ impl f32 {
726726
/// is finite `x == x.next_up().next_down()` also holds.
727727
///
728728
/// ```rust
729-
/// #![feature(float_next_up_down)]
730729
/// // f32::EPSILON is the difference between 1.0 and the next number up.
731730
/// assert_eq!(1.0f32.next_up(), 1.0 + f32::EPSILON);
732731
/// // But not for most numbers.
@@ -739,7 +738,8 @@ impl f32 {
739738
/// [`MIN`]: Self::MIN
740739
/// [`MAX`]: Self::MAX
741740
#[inline]
742-
#[unstable(feature = "float_next_up_down", issue = "91399")]
741+
#[stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")]
742+
#[rustc_const_stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")]
743743
pub const fn next_up(self) -> Self {
744744
// Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing
745745
// denormals to zero. This is in general unsound and unsupported, but here
@@ -774,7 +774,6 @@ impl f32 {
774774
/// is finite `x == x.next_down().next_up()` also holds.
775775
///
776776
/// ```rust
777-
/// #![feature(float_next_up_down)]
778777
/// let x = 1.0f32;
779778
/// // Clamp value into range [0, 1).
780779
/// let clamped = x.clamp(0.0, 1.0f32.next_down());
@@ -787,7 +786,8 @@ impl f32 {
787786
/// [`MIN`]: Self::MIN
788787
/// [`MAX`]: Self::MAX
789788
#[inline]
790-
#[unstable(feature = "float_next_up_down", issue = "91399")]
789+
#[stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")]
790+
#[rustc_const_stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")]
791791
pub const fn next_down(self) -> Self {
792792
// Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing
793793
// denormals to zero. This is in general unsound and unsupported, but here

‎core/src/num/f64.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,6 @@ impl f64 {
743743
/// is finite `x == x.next_up().next_down()` also holds.
744744
///
745745
/// ```rust
746-
/// #![feature(float_next_up_down)]
747746
/// // f64::EPSILON is the difference between 1.0 and the next number up.
748747
/// assert_eq!(1.0f64.next_up(), 1.0 + f64::EPSILON);
749748
/// // But not for most numbers.
@@ -756,7 +755,8 @@ impl f64 {
756755
/// [`MIN`]: Self::MIN
757756
/// [`MAX`]: Self::MAX
758757
#[inline]
759-
#[unstable(feature = "float_next_up_down", issue = "91399")]
758+
#[stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")]
759+
#[rustc_const_stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")]
760760
pub const fn next_up(self) -> Self {
761761
// Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing
762762
// denormals to zero. This is in general unsound and unsupported, but here
@@ -791,7 +791,6 @@ impl f64 {
791791
/// is finite `x == x.next_down().next_up()` also holds.
792792
///
793793
/// ```rust
794-
/// #![feature(float_next_up_down)]
795794
/// let x = 1.0f64;
796795
/// // Clamp value into range [0, 1).
797796
/// let clamped = x.clamp(0.0, 1.0f64.next_down());
@@ -804,7 +803,8 @@ impl f64 {
804803
/// [`MIN`]: Self::MIN
805804
/// [`MAX`]: Self::MAX
806805
#[inline]
807-
#[unstable(feature = "float_next_up_down", issue = "91399")]
806+
#[stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")]
807+
#[rustc_const_stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")]
808808
pub const fn next_down(self) -> Self {
809809
// Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing
810810
// denormals to zero. This is in general unsound and unsupported, but here

‎std/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,6 @@
333333
#![feature(extend_one)]
334334
#![feature(float_gamma)]
335335
#![feature(float_minimum_maximum)]
336-
#![feature(float_next_up_down)]
337336
#![feature(fmt_internals)]
338337
#![feature(hasher_prefixfree_extras)]
339338
#![feature(hashmap_internals)]

0 commit comments

Comments
 (0)
Please sign in to comment.