Rollup merge of #131289 - RalfJung:duration_consts_float, r=tgross35 · qinheping/verify-rust-std@4f124de (original) (raw)

`@@ -847,7 +847,7 @@ impl Duration {

`

847

847

`#[stable(feature = "duration_float", since = "1.38.0")]

`

848

848

`#[must_use]

`

849

849

`#[inline]

`

850

``

`-

#[rustc_const_unstable(feature = "duration_consts_float", issue = "72440")]

`

``

850

`+

#[rustc_const_stable(feature = "duration_consts_float", since = "CURRENT_RUSTC_VERSION")]

`

851

851

`pub const fn as_secs_f64(&self) -> f64 {

`

852

852

`(self.secs as f64) + (self.nanos.0 as f64) / (NANOS_PER_SEC as f64)

`

853

853

`}

`

`@@ -866,7 +866,7 @@ impl Duration {

`

866

866

`#[stable(feature = "duration_float", since = "1.38.0")]

`

867

867

`#[must_use]

`

868

868

`#[inline]

`

869

``

`-

#[rustc_const_unstable(feature = "duration_consts_float", issue = "72440")]

`

``

869

`+

#[rustc_const_stable(feature = "duration_consts_float", since = "CURRENT_RUSTC_VERSION")]

`

870

870

`pub const fn as_secs_f32(&self) -> f32 {

`

871

871

`(self.secs as f32) + (self.nanos.0 as f32) / (NANOS_PER_SEC as f32)

`

872

872

`}

`

`@@ -886,7 +886,7 @@ impl Duration {

`

886

886

`#[unstable(feature = "duration_millis_float", issue = "122451")]

`

887

887

`#[must_use]

`

888

888

`#[inline]

`

889

``

`-

#[rustc_const_unstable(feature = "duration_consts_float", issue = "72440")]

`

``

889

`+

#[rustc_const_unstable(feature = "duration_millis_float", issue = "122451")]

`

890

890

`pub const fn as_millis_f64(&self) -> f64 {

`

891

891

`(self.secs as f64) * (MILLIS_PER_SEC as f64)

`

892

892

` + (self.nanos.0 as f64) / (NANOS_PER_MILLI as f64)

`

`@@ -907,7 +907,7 @@ impl Duration {

`

907

907

`#[unstable(feature = "duration_millis_float", issue = "122451")]

`

908

908

`#[must_use]

`

909

909

`#[inline]

`

910

``

`-

#[rustc_const_unstable(feature = "duration_consts_float", issue = "72440")]

`

``

910

`+

#[rustc_const_unstable(feature = "duration_millis_float", issue = "122451")]

`

911

911

`pub const fn as_millis_f32(&self) -> f32 {

`

912

912

`(self.secs as f32) * (MILLIS_PER_SEC as f32)

`

913

913

` + (self.nanos.0 as f32) / (NANOS_PER_MILLI as f32)

`

`@@ -1087,7 +1087,7 @@ impl Duration {

`

1087

1087

`#[must_use = "this returns the result of the operation, \

`

1088

1088

` without modifying the original"]

`

1089

1089

`#[inline]

`

1090

``

`-

#[rustc_const_unstable(feature = "duration_consts_float", issue = "72440")]

`

``

1090

`+

#[rustc_const_stable(feature = "duration_consts_float", since = "CURRENT_RUSTC_VERSION")]

`

1091

1091

`pub const fn div_duration_f64(self, rhs: Duration) -> f64 {

`

1092

1092

`let self_nanos = (self.secs as f64) * (NANOS_PER_SEC as f64) + (self.nanos.0 as f64);

`

1093

1093

`let rhs_nanos = (rhs.secs as f64) * (NANOS_PER_SEC as f64) + (rhs.nanos.0 as f64);

`

`@@ -1108,7 +1108,7 @@ impl Duration {

`

1108

1108

`#[must_use = "this returns the result of the operation, \

`

1109

1109

` without modifying the original"]

`

1110

1110

`#[inline]

`

1111

``

`-

#[rustc_const_unstable(feature = "duration_consts_float", issue = "72440")]

`

``

1111

`+

#[rustc_const_stable(feature = "duration_consts_float", since = "CURRENT_RUSTC_VERSION")]

`

1112

1112

`pub const fn div_duration_f32(self, rhs: Duration) -> f32 {

`

1113

1113

`let self_nanos = (self.secs as f32) * (NANOS_PER_SEC as f32) + (self.nanos.0 as f32);

`

1114

1114

`let rhs_nanos = (rhs.secs as f32) * (NANOS_PER_SEC as f32) + (rhs.nanos.0 as f32);

`