Skip to content

Commit dc6606e

Browse files
Rollup merge of #43315 - est31:stabilize_float_bits_conv, r=alexcrichton
float_bits_conv made it into 1.20 It seems that my PR to stabilize the `float_bits_conv` feature got merged before beta branched, which means I'm lucky, and the stabilization makes it into Rust 1.20. As it was against my expectations, the version number has to be corrected from 1.21 to 1.20. Please also apply this PR to the beta branch.
2 parents 21a7b26 + ffefc9a commit dc6606e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/libstd/f32.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ impl f32 {
10941094
/// assert_eq!((12.5f32).to_bits(), 0x41480000);
10951095
///
10961096
/// ```
1097-
#[stable(feature = "float_bits_conv", since = "1.21.0")]
1097+
#[stable(feature = "float_bits_conv", since = "1.20.0")]
10981098
#[inline]
10991099
pub fn to_bits(self) -> u32 {
11001100
unsafe { ::mem::transmute(self) }
@@ -1125,7 +1125,7 @@ impl f32 {
11251125
/// let snan = 0x7F800001;
11261126
/// assert_ne!(f32::from_bits(snan).to_bits(), snan);
11271127
/// ```
1128-
#[stable(feature = "float_bits_conv", since = "1.21.0")]
1128+
#[stable(feature = "float_bits_conv", since = "1.20.0")]
11291129
#[inline]
11301130
pub fn from_bits(mut v: u32) -> Self {
11311131
const EXP_MASK: u32 = 0x7F800000;

src/libstd/f64.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ impl f64 {
10091009
/// assert_eq!((12.5f64).to_bits(), 0x4029000000000000);
10101010
///
10111011
/// ```
1012-
#[stable(feature = "float_bits_conv", since = "1.21.0")]
1012+
#[stable(feature = "float_bits_conv", since = "1.20.0")]
10131013
#[inline]
10141014
pub fn to_bits(self) -> u64 {
10151015
unsafe { ::mem::transmute(self) }
@@ -1040,7 +1040,7 @@ impl f64 {
10401040
/// let snan = 0x7FF0000000000001;
10411041
/// assert_ne!(f64::from_bits(snan).to_bits(), snan);
10421042
/// ```
1043-
#[stable(feature = "float_bits_conv", since = "1.21.0")]
1043+
#[stable(feature = "float_bits_conv", since = "1.20.0")]
10441044
#[inline]
10451045
pub fn from_bits(mut v: u64) -> Self {
10461046
const EXP_MASK: u64 = 0x7FF0000000000000;

0 commit comments

Comments
 (0)