Skip to content

Commit daeb607

Browse files
committed
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
1 parent 3fae481 commit daeb607

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

Diff for: src/liballoc/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@
101101
#![feature(i128_type)]
102102
#![feature(inclusive_range)]
103103
#![feature(lang_items)]
104-
#![feature(manually_drop)]
105104
#![feature(needs_allocator)]
106105
#![feature(nonzero)]
107106
#![feature(offset_to)]

Diff for: src/libcore/mem.rs

+7-10
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,6 @@ pub fn discriminant<T>(v: &T) -> Discriminant<T> {
838838
/// the type:
839839
///
840840
/// ```rust
841-
/// # #![feature(manually_drop)]
842841
/// use std::mem::ManuallyDrop;
843842
/// struct Peach;
844843
/// struct Banana;
@@ -864,7 +863,7 @@ pub fn discriminant<T>(v: &T) -> Discriminant<T> {
864863
/// }
865864
/// }
866865
/// ```
867-
#[unstable(feature = "manually_drop", issue = "40673")]
866+
#[stable(feature = "manually_drop", since = "1.20.0")]
868867
#[allow(unions_with_drop_fields)]
869868
pub union ManuallyDrop<T>{ value: T }
870869

@@ -874,11 +873,10 @@ impl<T> ManuallyDrop<T> {
874873
/// # Examples
875874
///
876875
/// ```rust
877-
/// # #![feature(manually_drop)]
878876
/// use std::mem::ManuallyDrop;
879877
/// ManuallyDrop::new(Box::new(()));
880878
/// ```
881-
#[unstable(feature = "manually_drop", issue = "40673")]
879+
#[stable(feature = "manually_drop", since = "1.20.0")]
882880
#[inline]
883881
pub fn new(value: T) -> ManuallyDrop<T> {
884882
ManuallyDrop { value: value }
@@ -889,12 +887,11 @@ impl<T> ManuallyDrop<T> {
889887
/// # Examples
890888
///
891889
/// ```rust
892-
/// # #![feature(manually_drop)]
893890
/// use std::mem::ManuallyDrop;
894891
/// let x = ManuallyDrop::new(Box::new(()));
895892
/// let _: Box<()> = ManuallyDrop::into_inner(x);
896893
/// ```
897-
#[unstable(feature = "manually_drop", issue = "40673")]
894+
#[stable(feature = "manually_drop", since = "1.20.0")]
898895
#[inline]
899896
pub fn into_inner(slot: ManuallyDrop<T>) -> T {
900897
unsafe {
@@ -909,14 +906,14 @@ impl<T> ManuallyDrop<T> {
909906
/// This function runs the destructor of the contained value and thus the wrapped value
910907
/// now represents uninitialized data. It is up to the user of this method to ensure the
911908
/// uninitialized data is not actually used.
912-
#[unstable(feature = "manually_drop", issue = "40673")]
909+
#[stable(feature = "manually_drop", since = "1.20.0")]
913910
#[inline]
914911
pub unsafe fn drop(slot: &mut ManuallyDrop<T>) {
915912
ptr::drop_in_place(&mut slot.value)
916913
}
917914
}
918915

919-
#[unstable(feature = "manually_drop", issue = "40673")]
916+
#[stable(feature = "manually_drop", since = "1.20.0")]
920917
impl<T> ::ops::Deref for ManuallyDrop<T> {
921918
type Target = T;
922919
#[inline]
@@ -927,7 +924,7 @@ impl<T> ::ops::Deref for ManuallyDrop<T> {
927924
}
928925
}
929926

930-
#[unstable(feature = "manually_drop", issue = "40673")]
927+
#[stable(feature = "manually_drop", since = "1.20.0")]
931928
impl<T> ::ops::DerefMut for ManuallyDrop<T> {
932929
#[inline]
933930
fn deref_mut(&mut self) -> &mut Self::Target {
@@ -937,7 +934,7 @@ impl<T> ::ops::DerefMut for ManuallyDrop<T> {
937934
}
938935
}
939936

940-
#[unstable(feature = "manually_drop", issue = "40673")]
937+
#[stable(feature = "manually_drop", since = "1.20.0")]
941938
impl<T: ::fmt::Debug> ::fmt::Debug for ManuallyDrop<T> {
942939
fn fmt(&self, fmt: &mut ::fmt::Formatter) -> ::fmt::Result {
943940
unsafe {

Diff for: src/librustc_data_structures/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#![feature(conservative_impl_trait)]
3535
#![feature(discriminant_value)]
3636
#![feature(specialization)]
37-
#![feature(manually_drop)]
3837

3938
#![cfg_attr(stage0, feature(associated_consts))]
4039
#![cfg_attr(stage0, feature(struct_field_attributes))]

0 commit comments

Comments
 (0)