about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-07-31 09:08:33 +0000
committerbors <bors@rust-lang.org>2018-07-31 09:08:33 +0000
commit896113201034946c7f49c1049288665fa2a56e32 (patch)
treee5f4541018e5345bcfe4a42f09aad34e713d6c24
parentd2652f6c1da28af0cdc22e8112b7d3b6b74ad9d7 (diff)
parentf162438fb3910b3b68f1b0aa664a3a89df1383de (diff)
downloadrust-896113201034946c7f49c1049288665fa2a56e32.tar.gz
rust-896113201034946c7f49c1049288665fa2a56e32.zip
Auto merge of #52850 - SimonSapin:unstablize, r=alexcrichton
Revert "Stabilize to_bytes and from_bytes for integers."

This reverts commit c8f9b84b393915a48253e3edc862c15a9b7152a7 / PR https://github.com/rust-lang/rust/pull/51835, and reopens the tracking issue https://github.com/rust-lang/rust/issues/49792.

These methods were stabilized in Rust 1.29, which is still in Nightly as of this writing. So my understanding is that it is still time to change our minds. Given the ongoing discussion in https://github.com/rust-lang/rust/pull/51919 about possibly renaming these APIs and since 1.29 goes to beta soon, I’d like to revert this stabilization for now until a decision is made in that PR. It’s possible that a decision will be made in time for 1.29, but there is no urgency. At most I expect this functionality to make it into 1.30.
-rw-r--r--src/libcore/num/mod.rs16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs
index 0b8f8f0703d..3bc2861460e 100644
--- a/src/libcore/num/mod.rs
+++ b/src/libcore/num/mod.rs
@@ -1903,10 +1903,12 @@ $EndFeature, "
         /// # Examples
         ///
         /// ```
+        /// #![feature(int_to_from_bytes)]
+        ///
         /// let bytes = i32::min_value().to_be().to_bytes();
         /// assert_eq!(bytes, [0x80, 0, 0, 0]);
         /// ```
-        #[stable(feature = "int_to_from_bytes", since = "1.29.0")]
+        #[unstable(feature = "int_to_from_bytes", issue = "49792")]
         #[inline]
         pub fn to_bytes(self) -> [u8; mem::size_of::<Self>()] {
             unsafe { mem::transmute(self) }
@@ -1923,10 +1925,12 @@ $EndFeature, "
         /// # Examples
         ///
         /// ```
+        /// #![feature(int_to_from_bytes)]
+        ///
         /// let int = i32::from_be(i32::from_bytes([0x80, 0, 0, 0]));
         /// assert_eq!(int, i32::min_value());
         /// ```
-        #[stable(feature = "int_to_from_bytes", since = "1.29.0")]
+        #[unstable(feature = "int_to_from_bytes", issue = "49792")]
         #[inline]
         pub fn from_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self {
             unsafe { mem::transmute(bytes) }
@@ -3508,10 +3512,12 @@ $EndFeature, "
         /// # Examples
         ///
         /// ```
+        /// #![feature(int_to_from_bytes)]
+        ///
         /// let bytes = 0x1234_5678_u32.to_be().to_bytes();
         /// assert_eq!(bytes, [0x12, 0x34, 0x56, 0x78]);
         /// ```
-        #[stable(feature = "int_to_from_bytes", since = "1.29.0")]
+        #[unstable(feature = "int_to_from_bytes", issue = "49792")]
         #[inline]
         pub fn to_bytes(self) -> [u8; mem::size_of::<Self>()] {
             unsafe { mem::transmute(self) }
@@ -3528,10 +3534,12 @@ $EndFeature, "
         /// # Examples
         ///
         /// ```
+        /// #![feature(int_to_from_bytes)]
+        ///
         /// let int = u32::from_be(u32::from_bytes([0x12, 0x34, 0x56, 0x78]));
         /// assert_eq!(int, 0x1234_5678_u32);
         /// ```
-        #[stable(feature = "int_to_from_bytes", since = "1.29.0")]
+        #[unstable(feature = "int_to_from_bytes", issue = "49792")]
         #[inline]
         pub fn from_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self {
             unsafe { mem::transmute(bytes) }