Skip to content

Commit 34ae991

Browse files
committed
Stabilize const_float_round_methods
1 parent 25cf7d1 commit 34ae991

File tree

8 files changed

+12
-38
lines changed

8 files changed

+12
-38
lines changed

library/core/src/num/f128.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,6 @@ impl f128 {
14481448
#[rustc_allow_incoherent_impl]
14491449
#[unstable(feature = "f128", issue = "116909")]
14501450
#[rustc_const_unstable(feature = "f128", issue = "116909")]
1451-
// #[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
14521451
#[must_use = "method returns a new number and does not mutate the original value"]
14531452
pub const fn floor(self) -> f128 {
14541453
// SAFETY: intrinsic with no preconditions
@@ -1478,7 +1477,6 @@ impl f128 {
14781477
#[rustc_allow_incoherent_impl]
14791478
#[unstable(feature = "f128", issue = "116909")]
14801479
#[rustc_const_unstable(feature = "f128", issue = "116909")]
1481-
// #[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
14821480
#[must_use = "method returns a new number and does not mutate the original value"]
14831481
pub const fn ceil(self) -> f128 {
14841482
// SAFETY: intrinsic with no preconditions
@@ -1514,7 +1512,6 @@ impl f128 {
15141512
#[rustc_allow_incoherent_impl]
15151513
#[unstable(feature = "f128", issue = "116909")]
15161514
#[rustc_const_unstable(feature = "f128", issue = "116909")]
1517-
// #[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
15181515
#[must_use = "method returns a new number and does not mutate the original value"]
15191516
pub const fn round(self) -> f128 {
15201517
// SAFETY: intrinsic with no preconditions
@@ -1548,7 +1545,6 @@ impl f128 {
15481545
#[rustc_allow_incoherent_impl]
15491546
#[unstable(feature = "f128", issue = "116909")]
15501547
#[rustc_const_unstable(feature = "f128", issue = "116909")]
1551-
// #[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
15521548
#[must_use = "method returns a new number and does not mutate the original value"]
15531549
pub const fn round_ties_even(self) -> f128 {
15541550
intrinsics::round_ties_even_f128(self)
@@ -1580,7 +1576,6 @@ impl f128 {
15801576
#[rustc_allow_incoherent_impl]
15811577
#[unstable(feature = "f128", issue = "116909")]
15821578
#[rustc_const_unstable(feature = "f128", issue = "116909")]
1583-
// #[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
15841579
#[must_use = "method returns a new number and does not mutate the original value"]
15851580
pub const fn trunc(self) -> f128 {
15861581
// SAFETY: intrinsic with no preconditions
@@ -1611,7 +1606,6 @@ impl f128 {
16111606
#[rustc_allow_incoherent_impl]
16121607
#[unstable(feature = "f128", issue = "116909")]
16131608
#[rustc_const_unstable(feature = "f128", issue = "116909")]
1614-
// #[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
16151609
#[must_use = "method returns a new number and does not mutate the original value"]
16161610
pub const fn fract(self) -> f128 {
16171611
self - self.trunc()

library/core/src/num/f16.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,7 +1424,6 @@ impl f16 {
14241424
#[rustc_allow_incoherent_impl]
14251425
#[unstable(feature = "f16", issue = "116909")]
14261426
#[rustc_const_unstable(feature = "f16", issue = "116909")]
1427-
// #[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
14281427
#[must_use = "method returns a new number and does not mutate the original value"]
14291428
pub const fn floor(self) -> f16 {
14301429
// SAFETY: intrinsic with no preconditions
@@ -1454,7 +1453,6 @@ impl f16 {
14541453
#[rustc_allow_incoherent_impl]
14551454
#[unstable(feature = "f16", issue = "116909")]
14561455
#[rustc_const_unstable(feature = "f16", issue = "116909")]
1457-
// #[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
14581456
#[must_use = "method returns a new number and does not mutate the original value"]
14591457
pub const fn ceil(self) -> f16 {
14601458
// SAFETY: intrinsic with no preconditions
@@ -1490,7 +1488,6 @@ impl f16 {
14901488
#[rustc_allow_incoherent_impl]
14911489
#[unstable(feature = "f16", issue = "116909")]
14921490
#[rustc_const_unstable(feature = "f16", issue = "116909")]
1493-
// #[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
14941491
#[must_use = "method returns a new number and does not mutate the original value"]
14951492
pub const fn round(self) -> f16 {
14961493
// SAFETY: intrinsic with no preconditions
@@ -1524,7 +1521,6 @@ impl f16 {
15241521
#[rustc_allow_incoherent_impl]
15251522
#[unstable(feature = "f16", issue = "116909")]
15261523
#[rustc_const_unstable(feature = "f16", issue = "116909")]
1527-
// #[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
15281524
#[must_use = "method returns a new number and does not mutate the original value"]
15291525
pub const fn round_ties_even(self) -> f16 {
15301526
intrinsics::round_ties_even_f16(self)
@@ -1556,7 +1552,6 @@ impl f16 {
15561552
#[rustc_allow_incoherent_impl]
15571553
#[unstable(feature = "f16", issue = "116909")]
15581554
#[rustc_const_unstable(feature = "f16", issue = "116909")]
1559-
// #[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
15601555
#[must_use = "method returns a new number and does not mutate the original value"]
15611556
pub const fn trunc(self) -> f16 {
15621557
// SAFETY: intrinsic with no preconditions
@@ -1587,7 +1582,6 @@ impl f16 {
15871582
#[rustc_allow_incoherent_impl]
15881583
#[unstable(feature = "f16", issue = "116909")]
15891584
#[rustc_const_unstable(feature = "f16", issue = "116909")]
1590-
// #[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
15911585
#[must_use = "method returns a new number and does not mutate the original value"]
15921586
pub const fn fract(self) -> f16 {
15931587
self - self.trunc()

library/core/src/num/f32.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,7 +1591,6 @@ 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 = "const_float_round_methods", issue = "141555")]
15951594
#[must_use = "method returns a new number and does not mutate the original value"]
15961595
pub const fn floor(x: f32) -> f32 {
15971596
// SAFETY: intrinsic with no preconditions
@@ -1622,7 +1621,6 @@ pub mod math {
16221621
#[doc(alias = "ceiling")]
16231622
#[must_use = "method returns a new number and does not mutate the original value"]
16241623
#[unstable(feature = "core_float_math", issue = "137578")]
1625-
#[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
16261624
pub const fn ceil(x: f32) -> f32 {
16271625
// SAFETY: intrinsic with no preconditions
16281626
unsafe { intrinsics::ceilf32(x) }
@@ -1657,7 +1655,6 @@ pub mod math {
16571655
#[inline]
16581656
#[unstable(feature = "core_float_math", issue = "137578")]
16591657
#[must_use = "method returns a new number and does not mutate the original value"]
1660-
#[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
16611658
pub const fn round(x: f32) -> f32 {
16621659
// SAFETY: intrinsic with no preconditions
16631660
unsafe { intrinsics::roundf32(x) }
@@ -1691,7 +1688,6 @@ pub mod math {
16911688
#[inline]
16921689
#[unstable(feature = "core_float_math", issue = "137578")]
16931690
#[must_use = "method returns a new number and does not mutate the original value"]
1694-
#[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
16951691
pub const fn round_ties_even(x: f32) -> f32 {
16961692
intrinsics::round_ties_even_f32(x)
16971693
}
@@ -1722,7 +1718,6 @@ pub mod math {
17221718
#[doc(alias = "truncate")]
17231719
#[must_use = "method returns a new number and does not mutate the original value"]
17241720
#[unstable(feature = "core_float_math", issue = "137578")]
1725-
#[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
17261721
pub const fn trunc(x: f32) -> f32 {
17271722
// SAFETY: intrinsic with no preconditions
17281723
unsafe { intrinsics::truncf32(x) }
@@ -1752,7 +1747,6 @@ pub mod math {
17521747
/// [`f32::fract`]: ../../../std/primitive.f32.html#method.fract
17531748
#[inline]
17541749
#[unstable(feature = "core_float_math", issue = "137578")]
1755-
#[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
17561750
#[must_use = "method returns a new number and does not mutate the original value"]
17571751
pub const fn fract(x: f32) -> f32 {
17581752
x - trunc(x)

library/core/src/num/f64.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,7 +1589,6 @@ 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 = "const_float_round_methods", issue = "141555")]
15931592
#[must_use = "method returns a new number and does not mutate the original value"]
15941593
pub const fn floor(x: f64) -> f64 {
15951594
// SAFETY: intrinsic with no preconditions
@@ -1619,7 +1618,6 @@ pub mod math {
16191618
#[inline]
16201619
#[doc(alias = "ceiling")]
16211620
#[unstable(feature = "core_float_math", issue = "137578")]
1622-
#[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
16231621
#[must_use = "method returns a new number and does not mutate the original value"]
16241622
pub const fn ceil(x: f64) -> f64 {
16251623
// SAFETY: intrinsic with no preconditions
@@ -1654,7 +1652,6 @@ pub mod math {
16541652
/// [`f64::round`]: ../../../std/primitive.f64.html#method.round
16551653
#[inline]
16561654
#[unstable(feature = "core_float_math", issue = "137578")]
1657-
#[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
16581655
#[must_use = "method returns a new number and does not mutate the original value"]
16591656
pub const fn round(x: f64) -> f64 {
16601657
// SAFETY: intrinsic with no preconditions
@@ -1688,7 +1685,6 @@ pub mod math {
16881685
/// [`f64::round_ties_even`]: ../../../std/primitive.f64.html#method.round_ties_even
16891686
#[inline]
16901687
#[unstable(feature = "core_float_math", issue = "137578")]
1691-
#[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
16921688
#[must_use = "method returns a new number and does not mutate the original value"]
16931689
pub const fn round_ties_even(x: f64) -> f64 {
16941690
intrinsics::round_ties_even_f64(x)
@@ -1719,7 +1715,6 @@ pub mod math {
17191715
#[inline]
17201716
#[doc(alias = "truncate")]
17211717
#[unstable(feature = "core_float_math", issue = "137578")]
1722-
#[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
17231718
#[must_use = "method returns a new number and does not mutate the original value"]
17241719
pub const fn trunc(x: f64) -> f64 {
17251720
// SAFETY: intrinsic with no preconditions
@@ -1750,7 +1745,6 @@ pub mod math {
17501745
/// [`f64::fract`]: ../../../std/primitive.f64.html#method.fract
17511746
#[inline]
17521747
#[unstable(feature = "core_float_math", issue = "137578")]
1753-
#[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
17541748
#[must_use = "method returns a new number and does not mutate the original value"]
17551749
pub const fn fract(x: f64) -> f64 {
17561750
x - trunc(x)

library/coretests/tests/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#![feature(const_deref)]
2020
#![feature(const_destruct)]
2121
#![feature(const_eval_select)]
22-
#![feature(const_float_round_methods)]
2322
#![feature(const_ref_cell)]
2423
#![feature(const_trait_impl)]
2524
#![feature(core_float_math)]

library/std/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,6 @@
329329
#![feature(bstr_internals)]
330330
#![feature(char_internals)]
331331
#![feature(clone_to_uninit)]
332-
#![feature(const_float_round_methods)]
333332
#![feature(core_intrinsics)]
334333
#![feature(core_io_borrowed_buf)]
335334
#![feature(duration_constants)]

library/std/src/num/f32.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl f32 {
4444
#[rustc_allow_incoherent_impl]
4545
#[must_use = "method returns a new number and does not mutate the original value"]
4646
#[stable(feature = "rust1", since = "1.0.0")]
47-
#[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
47+
#[rustc_const_stable(feature = "const_float_round_methods", since = "CURRENT_RUSTC_VERSION")]
4848
#[inline]
4949
pub const fn floor(self) -> f32 {
5050
core::f32::math::floor(self)
@@ -67,7 +67,7 @@ impl f32 {
6767
#[rustc_allow_incoherent_impl]
6868
#[must_use = "method returns a new number and does not mutate the original value"]
6969
#[stable(feature = "rust1", since = "1.0.0")]
70-
#[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
70+
#[rustc_const_stable(feature = "const_float_round_methods", since = "CURRENT_RUSTC_VERSION")]
7171
#[inline]
7272
pub const fn ceil(self) -> f32 {
7373
core::f32::math::ceil(self)
@@ -96,7 +96,7 @@ impl f32 {
9696
#[rustc_allow_incoherent_impl]
9797
#[must_use = "method returns a new number and does not mutate the original value"]
9898
#[stable(feature = "rust1", since = "1.0.0")]
99-
#[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
99+
#[rustc_const_stable(feature = "const_float_round_methods", since = "CURRENT_RUSTC_VERSION")]
100100
#[inline]
101101
pub const fn round(self) -> f32 {
102102
core::f32::math::round(self)
@@ -123,7 +123,7 @@ impl f32 {
123123
#[rustc_allow_incoherent_impl]
124124
#[must_use = "method returns a new number and does not mutate the original value"]
125125
#[stable(feature = "round_ties_even", since = "1.77.0")]
126-
#[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
126+
#[rustc_const_stable(feature = "const_float_round_methods", since = "CURRENT_RUSTC_VERSION")]
127127
#[inline]
128128
pub const fn round_ties_even(self) -> f32 {
129129
core::f32::math::round_ties_even(self)
@@ -149,7 +149,7 @@ impl f32 {
149149
#[rustc_allow_incoherent_impl]
150150
#[must_use = "method returns a new number and does not mutate the original value"]
151151
#[stable(feature = "rust1", since = "1.0.0")]
152-
#[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
152+
#[rustc_const_stable(feature = "const_float_round_methods", since = "CURRENT_RUSTC_VERSION")]
153153
#[inline]
154154
pub const fn trunc(self) -> f32 {
155155
core::f32::math::trunc(self)
@@ -173,7 +173,7 @@ impl f32 {
173173
#[rustc_allow_incoherent_impl]
174174
#[must_use = "method returns a new number and does not mutate the original value"]
175175
#[stable(feature = "rust1", since = "1.0.0")]
176-
#[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
176+
#[rustc_const_stable(feature = "const_float_round_methods", since = "CURRENT_RUSTC_VERSION")]
177177
#[inline]
178178
pub const fn fract(self) -> f32 {
179179
core::f32::math::fract(self)

library/std/src/num/f64.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl f64 {
4444
#[rustc_allow_incoherent_impl]
4545
#[must_use = "method returns a new number and does not mutate the original value"]
4646
#[stable(feature = "rust1", since = "1.0.0")]
47-
#[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
47+
#[rustc_const_stable(feature = "const_float_round_methods", since = "CURRENT_RUSTC_VERSION")]
4848
#[inline]
4949
pub const fn floor(self) -> f64 {
5050
core::f64::math::floor(self)
@@ -67,7 +67,7 @@ impl f64 {
6767
#[rustc_allow_incoherent_impl]
6868
#[must_use = "method returns a new number and does not mutate the original value"]
6969
#[stable(feature = "rust1", since = "1.0.0")]
70-
#[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
70+
#[rustc_const_stable(feature = "const_float_round_methods", since = "CURRENT_RUSTC_VERSION")]
7171
#[inline]
7272
pub const fn ceil(self) -> f64 {
7373
core::f64::math::ceil(self)
@@ -96,7 +96,7 @@ impl f64 {
9696
#[rustc_allow_incoherent_impl]
9797
#[must_use = "method returns a new number and does not mutate the original value"]
9898
#[stable(feature = "rust1", since = "1.0.0")]
99-
#[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
99+
#[rustc_const_stable(feature = "const_float_round_methods", since = "CURRENT_RUSTC_VERSION")]
100100
#[inline]
101101
pub const fn round(self) -> f64 {
102102
core::f64::math::round(self)
@@ -123,7 +123,7 @@ impl f64 {
123123
#[rustc_allow_incoherent_impl]
124124
#[must_use = "method returns a new number and does not mutate the original value"]
125125
#[stable(feature = "round_ties_even", since = "1.77.0")]
126-
#[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
126+
#[rustc_const_stable(feature = "const_float_round_methods", since = "CURRENT_RUSTC_VERSION")]
127127
#[inline]
128128
pub const fn round_ties_even(self) -> f64 {
129129
core::f64::math::round_ties_even(self)
@@ -149,7 +149,7 @@ impl f64 {
149149
#[rustc_allow_incoherent_impl]
150150
#[must_use = "method returns a new number and does not mutate the original value"]
151151
#[stable(feature = "rust1", since = "1.0.0")]
152-
#[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
152+
#[rustc_const_stable(feature = "const_float_round_methods", since = "CURRENT_RUSTC_VERSION")]
153153
#[inline]
154154
pub const fn trunc(self) -> f64 {
155155
core::f64::math::trunc(self)
@@ -173,7 +173,7 @@ impl f64 {
173173
#[rustc_allow_incoherent_impl]
174174
#[must_use = "method returns a new number and does not mutate the original value"]
175175
#[stable(feature = "rust1", since = "1.0.0")]
176-
#[rustc_const_unstable(feature = "const_float_round_methods", issue = "141555")]
176+
#[rustc_const_stable(feature = "const_float_round_methods", since = "CURRENT_RUSTC_VERSION")]
177177
#[inline]
178178
pub const fn fract(self) -> f64 {
179179
core::f64::math::fract(self)

0 commit comments

Comments
 (0)