about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2017-07-20 15:48:15 -0700
committerAlex Crichton <alex@alexcrichton.com>2017-07-25 07:09:31 -0700
commitdaeb6077c87dab99f2d301d06965558b8d064c28 (patch)
tree5d2e0bd91e7e7fc18a832bc119383ded2d3b9816 /src/libcore
parent3fae48107f62af7d2a6b0cf269dbda7b88f34f35 (diff)
downloadrust-daeb6077c87dab99f2d301d06965558b8d064c28.tar.gz
rust-daeb6077c87dab99f2d301d06965558b8d064c28.zip
std: Stabilize `manually_drop` feature
Stabilizes

* `core::mem::ManuallyDrop`
* `std::mem::ManuallyDrop`
* `ManuallyDrop::new`
* `ManuallyDrop::into_inner`
* `ManuallyDrop::drop`
* `Deref for ManuallyDrop`
* `DerefMut for ManuallyDrop`

Closes #40673
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/mem.rs17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs
index 86e5afa4c33..866296a5670 100644
--- a/src/libcore/mem.rs
+++ b/src/libcore/mem.rs
@@ -838,7 +838,6 @@ pub fn discriminant<T>(v: &T) -> Discriminant<T> {
 /// the type:
 ///
 /// ```rust
-/// # #![feature(manually_drop)]
 /// use std::mem::ManuallyDrop;
 /// struct Peach;
 /// struct Banana;
@@ -864,7 +863,7 @@ pub fn discriminant<T>(v: &T) -> Discriminant<T> {
 ///     }
 /// }
 /// ```
-#[unstable(feature = "manually_drop", issue = "40673")]
+#[stable(feature = "manually_drop", since = "1.20.0")]
 #[allow(unions_with_drop_fields)]
 pub union ManuallyDrop<T>{ value: T }
 
@@ -874,11 +873,10 @@ impl<T> ManuallyDrop<T> {
     /// # Examples
     ///
     /// ```rust
-    /// # #![feature(manually_drop)]
     /// use std::mem::ManuallyDrop;
     /// ManuallyDrop::new(Box::new(()));
     /// ```
-    #[unstable(feature = "manually_drop", issue = "40673")]
+    #[stable(feature = "manually_drop", since = "1.20.0")]
     #[inline]
     pub fn new(value: T) -> ManuallyDrop<T> {
         ManuallyDrop { value: value }
@@ -889,12 +887,11 @@ impl<T> ManuallyDrop<T> {
     /// # Examples
     ///
     /// ```rust
-    /// # #![feature(manually_drop)]
     /// use std::mem::ManuallyDrop;
     /// let x = ManuallyDrop::new(Box::new(()));
     /// let _: Box<()> = ManuallyDrop::into_inner(x);
     /// ```
-    #[unstable(feature = "manually_drop", issue = "40673")]
+    #[stable(feature = "manually_drop", since = "1.20.0")]
     #[inline]
     pub fn into_inner(slot: ManuallyDrop<T>) -> T {
         unsafe {
@@ -909,14 +906,14 @@ impl<T> ManuallyDrop<T> {
     /// This function runs the destructor of the contained value and thus the wrapped value
     /// now represents uninitialized data. It is up to the user of this method to ensure the
     /// uninitialized data is not actually used.
-    #[unstable(feature = "manually_drop", issue = "40673")]
+    #[stable(feature = "manually_drop", since = "1.20.0")]
     #[inline]
     pub unsafe fn drop(slot: &mut ManuallyDrop<T>) {
         ptr::drop_in_place(&mut slot.value)
     }
 }
 
-#[unstable(feature = "manually_drop", issue = "40673")]
+#[stable(feature = "manually_drop", since = "1.20.0")]
 impl<T> ::ops::Deref for ManuallyDrop<T> {
     type Target = T;
     #[inline]
@@ -927,7 +924,7 @@ impl<T> ::ops::Deref for ManuallyDrop<T> {
     }
 }
 
-#[unstable(feature = "manually_drop", issue = "40673")]
+#[stable(feature = "manually_drop", since = "1.20.0")]
 impl<T> ::ops::DerefMut for ManuallyDrop<T> {
     #[inline]
     fn deref_mut(&mut self) -> &mut Self::Target {
@@ -937,7 +934,7 @@ impl<T> ::ops::DerefMut for ManuallyDrop<T> {
     }
 }
 
-#[unstable(feature = "manually_drop", issue = "40673")]
+#[stable(feature = "manually_drop", since = "1.20.0")]
 impl<T: ::fmt::Debug> ::fmt::Debug for ManuallyDrop<T> {
     fn fmt(&self, fmt: &mut ::fmt::Formatter) -> ::fmt::Result {
         unsafe {