]> git.lizzy.rs Git - rust.git/commitdiff
Revert "Stabilize to_bytes and from_bytes for integers."
authorSimon Sapin <simon.sapin@exyr.org>
Mon, 30 Jul 2018 09:55:20 +0000 (11:55 +0200)
committerSimon Sapin <simon.sapin@exyr.org>
Mon, 30 Jul 2018 09:55:20 +0000 (11:55 +0200)
This reverts commit c8f9b84b393915a48253e3edc862c15a9b7152a7.

src/libcore/num/mod.rs

index 0b8f8f0703df79739414df45ad0b4670a8851897..3bc2861460e1455024c9e1dc06c58d3b8c2de2a7 100644 (file)
@@ -1903,10 +1903,12 @@ pub fn is_negative(self) -> bool { self < 0 }
         /// # 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 @@ pub fn is_negative(self) -> bool { self < 0 }
         /// # 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 @@ pub fn wrapping_next_power_of_two(self) -> Self {
         /// # 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 @@ pub fn wrapping_next_power_of_two(self) -> Self {
         /// # 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) }