Skip to content

Commit b98547b

Browse files
committed
Stabilize float_bits_conv
1 parent 3ba0f07 commit b98547b

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

Diff for: src/libstd/f32.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1090,12 +1090,11 @@ impl f32 {
10901090
/// # Examples
10911091
///
10921092
/// ```
1093-
/// #![feature(float_bits_conv)]
10941093
/// assert_ne!((1f32).to_bits(), 1f32 as u32); // to_bits() is not casting!
10951094
/// assert_eq!((12.5f32).to_bits(), 0x41480000);
10961095
///
10971096
/// ```
1098-
#[unstable(feature = "float_bits_conv", reason = "recently added", issue = "40470")]
1097+
#[stable(feature = "float_bits_conv", since = "1.20.0")]
10991098
#[inline]
11001099
pub fn to_bits(self) -> u32 {
11011100
unsafe { ::mem::transmute(self) }
@@ -1118,7 +1117,6 @@ impl f32 {
11181117
/// # Examples
11191118
///
11201119
/// ```
1121-
/// #![feature(float_bits_conv)]
11221120
/// use std::f32;
11231121
/// let v = f32::from_bits(0x41480000);
11241122
/// let difference = (v - 12.5).abs();
@@ -1127,7 +1125,7 @@ impl f32 {
11271125
/// let snan = 0x7F800001;
11281126
/// assert_ne!(f32::from_bits(snan).to_bits(), snan);
11291127
/// ```
1130-
#[unstable(feature = "float_bits_conv", reason = "recently added", issue = "40470")]
1128+
#[stable(feature = "float_bits_conv", since = "1.20.0")]
11311129
#[inline]
11321130
pub fn from_bits(mut v: u32) -> Self {
11331131
const EXP_MASK: u32 = 0x7F800000;

Diff for: src/libstd/f64.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1005,12 +1005,11 @@ impl f64 {
10051005
/// # Examples
10061006
///
10071007
/// ```
1008-
/// #![feature(float_bits_conv)]
10091008
/// assert!((1f64).to_bits() != 1f64 as u64); // to_bits() is not casting!
10101009
/// assert_eq!((12.5f64).to_bits(), 0x4029000000000000);
10111010
///
10121011
/// ```
1013-
#[unstable(feature = "float_bits_conv", reason = "recently added", issue = "40470")]
1012+
#[stable(feature = "float_bits_conv", since = "1.20.0")]
10141013
#[inline]
10151014
pub fn to_bits(self) -> u64 {
10161015
unsafe { ::mem::transmute(self) }
@@ -1033,7 +1032,6 @@ impl f64 {
10331032
/// # Examples
10341033
///
10351034
/// ```
1036-
/// #![feature(float_bits_conv)]
10371035
/// use std::f64;
10381036
/// let v = f64::from_bits(0x4029000000000000);
10391037
/// let difference = (v - 12.5).abs();
@@ -1042,7 +1040,7 @@ impl f64 {
10421040
/// let snan = 0x7FF0000000000001;
10431041
/// assert_ne!(f64::from_bits(snan).to_bits(), snan);
10441042
/// ```
1045-
#[unstable(feature = "float_bits_conv", reason = "recently added", issue = "40470")]
1043+
#[stable(feature = "float_bits_conv", since = "1.20.0")]
10461044
#[inline]
10471045
pub fn from_bits(mut v: u64) -> Self {
10481046
const EXP_MASK: u64 = 0x7FF0000000000000;

Diff for: src/libstd/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@
320320
#![feature(unwind_attributes)]
321321
#![feature(vec_push_all)]
322322
#![cfg_attr(test, feature(update_panic_count))]
323-
#![cfg_attr(test, feature(float_bits_conv))]
324323

325324
// Explicitly import the prelude. The compiler uses this same unstable attribute
326325
// to import the prelude implicitly when building crates that depend on std.

0 commit comments

Comments
 (0)