1
Fork 0

Stabilize float_next_up_down

FCP completed at [1].

Closes https://github.com/rust-lang/rust/issues/91399

[1]: https://github.com/rust-lang/rust/issues/91399#issuecomment-2598734570
This commit is contained in:
Trevor Gross 2025-01-17 22:47:24 +00:00
parent bcd0683e5d
commit 366cecacdd
5 changed files with 8 additions and 17 deletions

View file

@ -504,7 +504,6 @@ impl f128 {
/// ///
/// ```rust /// ```rust
/// #![feature(f128)] /// #![feature(f128)]
/// #![feature(float_next_up_down)]
/// # // FIXME(f16_f128): remove when `eqtf2` is available /// # // FIXME(f16_f128): remove when `eqtf2` is available
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] { /// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
/// ///
@ -522,7 +521,6 @@ impl f128 {
/// [`MAX`]: Self::MAX /// [`MAX`]: Self::MAX
#[inline] #[inline]
#[unstable(feature = "f128", issue = "116909")] #[unstable(feature = "f128", issue = "116909")]
// #[unstable(feature = "float_next_up_down", issue = "91399")]
pub const fn next_up(self) -> Self { pub const fn next_up(self) -> Self {
// Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing // Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing
// denormals to zero. This is in general unsound and unsupported, but here // denormals to zero. This is in general unsound and unsupported, but here
@ -558,7 +556,6 @@ impl f128 {
/// ///
/// ```rust /// ```rust
/// #![feature(f128)] /// #![feature(f128)]
/// #![feature(float_next_up_down)]
/// # // FIXME(f16_f128): remove when `eqtf2` is available /// # // FIXME(f16_f128): remove when `eqtf2` is available
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] { /// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
/// ///
@ -576,7 +573,6 @@ impl f128 {
/// [`MAX`]: Self::MAX /// [`MAX`]: Self::MAX
#[inline] #[inline]
#[unstable(feature = "f128", issue = "116909")] #[unstable(feature = "f128", issue = "116909")]
// #[unstable(feature = "float_next_up_down", issue = "91399")]
pub const fn next_down(self) -> Self { pub const fn next_down(self) -> Self {
// Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing // Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing
// denormals to zero. This is in general unsound and unsupported, but here // denormals to zero. This is in general unsound and unsupported, but here

View file

@ -497,7 +497,6 @@ impl f16 {
/// ///
/// ```rust /// ```rust
/// #![feature(f16)] /// #![feature(f16)]
/// #![feature(float_next_up_down)]
/// # // FIXME(f16_f128): ABI issues on MSVC /// # // FIXME(f16_f128): ABI issues on MSVC
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] { /// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
/// ///
@ -515,7 +514,6 @@ impl f16 {
/// [`MAX`]: Self::MAX /// [`MAX`]: Self::MAX
#[inline] #[inline]
#[unstable(feature = "f16", issue = "116909")] #[unstable(feature = "f16", issue = "116909")]
// #[unstable(feature = "float_next_up_down", issue = "91399")]
pub const fn next_up(self) -> Self { pub const fn next_up(self) -> Self {
// Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing // Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing
// denormals to zero. This is in general unsound and unsupported, but here // denormals to zero. This is in general unsound and unsupported, but here
@ -551,7 +549,6 @@ impl f16 {
/// ///
/// ```rust /// ```rust
/// #![feature(f16)] /// #![feature(f16)]
/// #![feature(float_next_up_down)]
/// # // FIXME(f16_f128): ABI issues on MSVC /// # // FIXME(f16_f128): ABI issues on MSVC
/// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] { /// # #[cfg(all(target_arch = "x86_64", target_os = "linux"))] {
/// ///
@ -569,7 +566,6 @@ impl f16 {
/// [`MAX`]: Self::MAX /// [`MAX`]: Self::MAX
#[inline] #[inline]
#[unstable(feature = "f16", issue = "116909")] #[unstable(feature = "f16", issue = "116909")]
// #[unstable(feature = "float_next_up_down", issue = "91399")]
pub const fn next_down(self) -> Self { pub const fn next_down(self) -> Self {
// Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing // Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing
// denormals to zero. This is in general unsound and unsupported, but here // denormals to zero. This is in general unsound and unsupported, but here

View file

@ -726,7 +726,6 @@ impl f32 {
/// is finite `x == x.next_up().next_down()` also holds. /// is finite `x == x.next_up().next_down()` also holds.
/// ///
/// ```rust /// ```rust
/// #![feature(float_next_up_down)]
/// // f32::EPSILON is the difference between 1.0 and the next number up. /// // f32::EPSILON is the difference between 1.0 and the next number up.
/// assert_eq!(1.0f32.next_up(), 1.0 + f32::EPSILON); /// assert_eq!(1.0f32.next_up(), 1.0 + f32::EPSILON);
/// // But not for most numbers. /// // But not for most numbers.
@ -739,7 +738,8 @@ impl f32 {
/// [`MIN`]: Self::MIN /// [`MIN`]: Self::MIN
/// [`MAX`]: Self::MAX /// [`MAX`]: Self::MAX
#[inline] #[inline]
#[unstable(feature = "float_next_up_down", issue = "91399")] #[stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")]
pub const fn next_up(self) -> Self { pub const fn next_up(self) -> Self {
// Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing // Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing
// denormals to zero. This is in general unsound and unsupported, but here // denormals to zero. This is in general unsound and unsupported, but here
@ -774,7 +774,6 @@ impl f32 {
/// is finite `x == x.next_down().next_up()` also holds. /// is finite `x == x.next_down().next_up()` also holds.
/// ///
/// ```rust /// ```rust
/// #![feature(float_next_up_down)]
/// let x = 1.0f32; /// let x = 1.0f32;
/// // Clamp value into range [0, 1). /// // Clamp value into range [0, 1).
/// let clamped = x.clamp(0.0, 1.0f32.next_down()); /// let clamped = x.clamp(0.0, 1.0f32.next_down());
@ -787,7 +786,8 @@ impl f32 {
/// [`MIN`]: Self::MIN /// [`MIN`]: Self::MIN
/// [`MAX`]: Self::MAX /// [`MAX`]: Self::MAX
#[inline] #[inline]
#[unstable(feature = "float_next_up_down", issue = "91399")] #[stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")]
pub const fn next_down(self) -> Self { pub const fn next_down(self) -> Self {
// Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing // Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing
// denormals to zero. This is in general unsound and unsupported, but here // denormals to zero. This is in general unsound and unsupported, but here

View file

@ -743,7 +743,6 @@ impl f64 {
/// is finite `x == x.next_up().next_down()` also holds. /// is finite `x == x.next_up().next_down()` also holds.
/// ///
/// ```rust /// ```rust
/// #![feature(float_next_up_down)]
/// // f64::EPSILON is the difference between 1.0 and the next number up. /// // f64::EPSILON is the difference between 1.0 and the next number up.
/// assert_eq!(1.0f64.next_up(), 1.0 + f64::EPSILON); /// assert_eq!(1.0f64.next_up(), 1.0 + f64::EPSILON);
/// // But not for most numbers. /// // But not for most numbers.
@ -756,7 +755,8 @@ impl f64 {
/// [`MIN`]: Self::MIN /// [`MIN`]: Self::MIN
/// [`MAX`]: Self::MAX /// [`MAX`]: Self::MAX
#[inline] #[inline]
#[unstable(feature = "float_next_up_down", issue = "91399")] #[stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")]
pub const fn next_up(self) -> Self { pub const fn next_up(self) -> Self {
// Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing // Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing
// denormals to zero. This is in general unsound and unsupported, but here // denormals to zero. This is in general unsound and unsupported, but here
@ -791,7 +791,6 @@ impl f64 {
/// is finite `x == x.next_down().next_up()` also holds. /// is finite `x == x.next_down().next_up()` also holds.
/// ///
/// ```rust /// ```rust
/// #![feature(float_next_up_down)]
/// let x = 1.0f64; /// let x = 1.0f64;
/// // Clamp value into range [0, 1). /// // Clamp value into range [0, 1).
/// let clamped = x.clamp(0.0, 1.0f64.next_down()); /// let clamped = x.clamp(0.0, 1.0f64.next_down());
@ -804,7 +803,8 @@ impl f64 {
/// [`MIN`]: Self::MIN /// [`MIN`]: Self::MIN
/// [`MAX`]: Self::MAX /// [`MAX`]: Self::MAX
#[inline] #[inline]
#[unstable(feature = "float_next_up_down", issue = "91399")] #[stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")]
pub const fn next_down(self) -> Self { pub const fn next_down(self) -> Self {
// Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing // Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing
// denormals to zero. This is in general unsound and unsupported, but here // denormals to zero. This is in general unsound and unsupported, but here

View file

@ -333,7 +333,6 @@
#![feature(extend_one)] #![feature(extend_one)]
#![feature(float_gamma)] #![feature(float_gamma)]
#![feature(float_minimum_maximum)] #![feature(float_minimum_maximum)]
#![feature(float_next_up_down)]
#![feature(fmt_internals)] #![feature(fmt_internals)]
#![feature(hasher_prefixfree_extras)] #![feature(hasher_prefixfree_extras)]
#![feature(hashmap_internals)] #![feature(hashmap_internals)]