move f16/f128 const fn under f16/f128 feature gate · qinheping/verify-rust-std@575391b (original) (raw)

`@@ -896,7 +896,7 @@ impl f16 {

`

896

896

```` /// ```


`897`

`897`

`#[inline]

`

`898`

`898`

`#[unstable(feature = "f16", issue = "116909")]

`

`899`

``

`-

#[rustc_const_unstable(feature = "f16_const", issue = "116909")]

`

``

`899`

`+

#[rustc_const_unstable(feature = "f16", issue = "116909")]

`

`900`

`900`

`#[must_use = "this returns the result of the operation, without modifying the original"]

`

`901`

`901`

`pub const fn to_bits(self) -> u16 {

`

`902`

`902`

`` // SAFETY: `u16` is a plain old datatype so we can always transmute to it.

``

`@@ -944,7 +944,7 @@ impl f16 {

`

`944`

`944`

`#[inline]

`

`945`

`945`

`#[must_use]

`

`946`

`946`

`#[unstable(feature = "f16", issue = "116909")]

`

`947`

``

`-

#[rustc_const_unstable(feature = "f16_const", issue = "116909")]

`

``

`947`

`+

#[rustc_const_unstable(feature = "f16", issue = "116909")]

`

`948`

`948`

`pub const fn from_bits(v: u16) -> Self {

`

`949`

`949`

`// It turns out the safety issues with sNaN were overblown! Hooray!

`

`950`

`950`

`` // SAFETY: `u16` is a plain old datatype so we can always transmute from it.

``

`@@ -970,7 +970,7 @@ impl f16 {

`

`970`

`970`

```` /// ```

971

971

`#[inline]

`

972

972

`#[unstable(feature = "f16", issue = "116909")]

`

973

``

`-

#[rustc_const_unstable(feature = "f16_const", issue = "116909")]

`

``

973

`+

#[rustc_const_unstable(feature = "f16", issue = "116909")]

`

974

974

`#[must_use = "this returns the result of the operation, without modifying the original"]

`

975

975

`pub const fn to_be_bytes(self) -> [u8; 2] {

`

976

976

`self.to_bits().to_be_bytes()

`

`@@ -995,7 +995,7 @@ impl f16 {

`

995

995

```` /// ```


`996`

`996`

`#[inline]

`

`997`

`997`

`#[unstable(feature = "f16", issue = "116909")]

`

`998`

``

`-

#[rustc_const_unstable(feature = "f16_const", issue = "116909")]

`

``

`998`

`+

#[rustc_const_unstable(feature = "f16", issue = "116909")]

`

`999`

`999`

`#[must_use = "this returns the result of the operation, without modifying the original"]

`

`1000`

`1000`

`pub const fn to_le_bytes(self) -> [u8; 2] {

`

`1001`

`1001`

`self.to_bits().to_le_bytes()

`

`@@ -1033,7 +1033,7 @@ impl f16 {

`

`1033`

`1033`

```` /// ```

1034

1034

`#[inline]

`

1035

1035

`#[unstable(feature = "f16", issue = "116909")]

`

1036

``

`-

#[rustc_const_unstable(feature = "f16_const", issue = "116909")]

`

``

1036

`+

#[rustc_const_unstable(feature = "f16", issue = "116909")]

`

1037

1037

`#[must_use = "this returns the result of the operation, without modifying the original"]

`

1038

1038

`pub const fn to_ne_bytes(self) -> [u8; 2] {

`

1039

1039

`self.to_bits().to_ne_bytes()

`

`@@ -1057,7 +1057,7 @@ impl f16 {

`

1057

1057

`#[inline]

`

1058

1058

`#[must_use]

`

1059

1059

`#[unstable(feature = "f16", issue = "116909")]

`

1060

``

`-

#[rustc_const_unstable(feature = "f16_const", issue = "116909")]

`

``

1060

`+

#[rustc_const_unstable(feature = "f16", issue = "116909")]

`

1061

1061

`pub const fn from_be_bytes(bytes: [u8; 2]) -> Self {

`

1062

1062

`Self::from_bits(u16::from_be_bytes(bytes))

`

1063

1063

`}

`

`@@ -1080,7 +1080,7 @@ impl f16 {

`

1080

1080

`#[inline]

`

1081

1081

`#[must_use]

`

1082

1082

`#[unstable(feature = "f16", issue = "116909")]

`

1083

``

`-

#[rustc_const_unstable(feature = "f16_const", issue = "116909")]

`

``

1083

`+

#[rustc_const_unstable(feature = "f16", issue = "116909")]

`

1084

1084

`pub const fn from_le_bytes(bytes: [u8; 2]) -> Self {

`

1085

1085

`Self::from_bits(u16::from_le_bytes(bytes))

`

1086

1086

`}

`

`@@ -1114,7 +1114,7 @@ impl f16 {

`

1114

1114

`#[inline]

`

1115

1115

`#[must_use]

`

1116

1116

`#[unstable(feature = "f16", issue = "116909")]

`

1117

``

`-

#[rustc_const_unstable(feature = "f16_const", issue = "116909")]

`

``

1117

`+

#[rustc_const_unstable(feature = "f16", issue = "116909")]

`

1118

1118

`pub const fn from_ne_bytes(bytes: [u8; 2]) -> Self {

`

1119

1119

`Self::from_bits(u16::from_ne_bytes(bytes))

`

1120

1120

`}

`