Skip to content

Commit 5df1124

Browse files
committed
Replace const_float_round_methods with core_float_math in const stability attribute
1 parent 34ae991 commit 5df1124

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

library/core/src/num/f32.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,6 +1591,7 @@ pub mod math {
15911591
/// [`f32::floor`]: ../../../std/primitive.f32.html#method.floor
15921592
#[inline]
15931593
#[unstable(feature = "core_float_math", issue = "137578")]
1594+
#[rustc_const_unstable(feature = "core_float_math", issue = "137578")]
15941595
#[must_use = "method returns a new number and does not mutate the original value"]
15951596
pub const fn floor(x: f32) -> f32 {
15961597
// SAFETY: intrinsic with no preconditions
@@ -1621,6 +1622,7 @@ pub mod math {
16211622
#[doc(alias = "ceiling")]
16221623
#[must_use = "method returns a new number and does not mutate the original value"]
16231624
#[unstable(feature = "core_float_math", issue = "137578")]
1625+
#[rustc_const_unstable(feature = "core_float_math", issue = "137578")]
16241626
pub const fn ceil(x: f32) -> f32 {
16251627
// SAFETY: intrinsic with no preconditions
16261628
unsafe { intrinsics::ceilf32(x) }
@@ -1654,6 +1656,7 @@ pub mod math {
16541656
/// [`f32::round`]: ../../../std/primitive.f32.html#method.round
16551657
#[inline]
16561658
#[unstable(feature = "core_float_math", issue = "137578")]
1659+
#[rustc_const_unstable(feature = "core_float_math", issue = "137578")]
16571660
#[must_use = "method returns a new number and does not mutate the original value"]
16581661
pub const fn round(x: f32) -> f32 {
16591662
// SAFETY: intrinsic with no preconditions
@@ -1687,6 +1690,7 @@ pub mod math {
16871690
/// [`f32::round_ties_even`]: ../../../std/primitive.f32.html#method.round_ties_even
16881691
#[inline]
16891692
#[unstable(feature = "core_float_math", issue = "137578")]
1693+
#[rustc_const_unstable(feature = "core_float_math", issue = "137578")]
16901694
#[must_use = "method returns a new number and does not mutate the original value"]
16911695
pub const fn round_ties_even(x: f32) -> f32 {
16921696
intrinsics::round_ties_even_f32(x)
@@ -1718,6 +1722,7 @@ pub mod math {
17181722
#[doc(alias = "truncate")]
17191723
#[must_use = "method returns a new number and does not mutate the original value"]
17201724
#[unstable(feature = "core_float_math", issue = "137578")]
1725+
#[rustc_const_unstable(feature = "core_float_math", issue = "137578")]
17211726
pub const fn trunc(x: f32) -> f32 {
17221727
// SAFETY: intrinsic with no preconditions
17231728
unsafe { intrinsics::truncf32(x) }
@@ -1747,6 +1752,7 @@ pub mod math {
17471752
/// [`f32::fract`]: ../../../std/primitive.f32.html#method.fract
17481753
#[inline]
17491754
#[unstable(feature = "core_float_math", issue = "137578")]
1755+
#[rustc_const_unstable(feature = "core_float_math", issue = "137578")]
17501756
#[must_use = "method returns a new number and does not mutate the original value"]
17511757
pub const fn fract(x: f32) -> f32 {
17521758
x - trunc(x)

library/core/src/num/f64.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,6 +1589,7 @@ pub mod math {
15891589
/// [`f64::floor`]: ../../../std/primitive.f64.html#method.floor
15901590
#[inline]
15911591
#[unstable(feature = "core_float_math", issue = "137578")]
1592+
#[rustc_const_unstable(feature = "core_float_math", issue = "137578")]
15921593
#[must_use = "method returns a new number and does not mutate the original value"]
15931594
pub const fn floor(x: f64) -> f64 {
15941595
// SAFETY: intrinsic with no preconditions
@@ -1618,6 +1619,7 @@ pub mod math {
16181619
#[inline]
16191620
#[doc(alias = "ceiling")]
16201621
#[unstable(feature = "core_float_math", issue = "137578")]
1622+
#[rustc_const_unstable(feature = "core_float_math", issue = "137578")]
16211623
#[must_use = "method returns a new number and does not mutate the original value"]
16221624
pub const fn ceil(x: f64) -> f64 {
16231625
// SAFETY: intrinsic with no preconditions
@@ -1652,6 +1654,7 @@ pub mod math {
16521654
/// [`f64::round`]: ../../../std/primitive.f64.html#method.round
16531655
#[inline]
16541656
#[unstable(feature = "core_float_math", issue = "137578")]
1657+
#[rustc_const_unstable(feature = "core_float_math", issue = "137578")]
16551658
#[must_use = "method returns a new number and does not mutate the original value"]
16561659
pub const fn round(x: f64) -> f64 {
16571660
// SAFETY: intrinsic with no preconditions
@@ -1685,6 +1688,7 @@ pub mod math {
16851688
/// [`f64::round_ties_even`]: ../../../std/primitive.f64.html#method.round_ties_even
16861689
#[inline]
16871690
#[unstable(feature = "core_float_math", issue = "137578")]
1691+
#[rustc_const_unstable(feature = "core_float_math", issue = "137578")]
16881692
#[must_use = "method returns a new number and does not mutate the original value"]
16891693
pub const fn round_ties_even(x: f64) -> f64 {
16901694
intrinsics::round_ties_even_f64(x)
@@ -1715,6 +1719,7 @@ pub mod math {
17151719
#[inline]
17161720
#[doc(alias = "truncate")]
17171721
#[unstable(feature = "core_float_math", issue = "137578")]
1722+
#[rustc_const_unstable(feature = "core_float_math", issue = "137578")]
17181723
#[must_use = "method returns a new number and does not mutate the original value"]
17191724
pub const fn trunc(x: f64) -> f64 {
17201725
// SAFETY: intrinsic with no preconditions
@@ -1745,6 +1750,7 @@ pub mod math {
17451750
/// [`f64::fract`]: ../../../std/primitive.f64.html#method.fract
17461751
#[inline]
17471752
#[unstable(feature = "core_float_math", issue = "137578")]
1753+
#[rustc_const_unstable(feature = "core_float_math", issue = "137578")]
17481754
#[must_use = "method returns a new number and does not mutate the original value"]
17491755
pub const fn fract(x: f64) -> f64 {
17501756
x - trunc(x)

0 commit comments

Comments
 (0)