Skip to content

Commit 7e22e24

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 59ccb2f commit 7e22e24

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

src/liballoc/lib.rs

Lines changed: 0 additions & 1 deletion
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)]

src/libcore/mem.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,6 @@ pub fn discriminant<T>(v: &T) -> Discriminant<T> {
795795
/// the type:
796796
///
797797
/// ```rust
798-
/// # #![feature(manually_drop)]
799798
/// use std::mem::ManuallyDrop;
800799
/// struct Peach;
801800
/// struct Banana;
@@ -821,7 +820,7 @@ pub fn discriminant<T>(v: &T) -> Discriminant<T> {
821820
/// }
822821
/// }
823822
/// ```
824-
#[unstable(feature = "manually_drop", issue = "40673")]
823+
#[stable(feature = "manually_drop", since = "1.20.0")]
825824
#[allow(unions_with_drop_fields)]
826825
pub union ManuallyDrop<T>{ value: T }
827826

@@ -831,11 +830,10 @@ impl<T> ManuallyDrop<T> {
831830
/// # Examples
832831
///
833832
/// ```rust
834-
/// # #![feature(manually_drop)]
835833
/// use std::mem::ManuallyDrop;
836834
/// ManuallyDrop::new(Box::new(()));
837835
/// ```
838-
#[unstable(feature = "manually_drop", issue = "40673")]
836+
#[stable(feature = "manually_drop", since = "1.20.0")]
839837
#[inline]
840838
pub fn new(value: T) -> ManuallyDrop<T> {
841839
ManuallyDrop { value: value }
@@ -846,12 +844,11 @@ impl<T> ManuallyDrop<T> {
846844
/// # Examples
847845
///
848846
/// ```rust
849-
/// # #![feature(manually_drop)]
850847
/// use std::mem::ManuallyDrop;
851848
/// let x = ManuallyDrop::new(Box::new(()));
852849
/// let _: Box<()> = ManuallyDrop::into_inner(x);
853850
/// ```
854-
#[unstable(feature = "manually_drop", issue = "40673")]
851+
#[stable(feature = "manually_drop", since = "1.20.0")]
855852
#[inline]
856853
pub fn into_inner(slot: ManuallyDrop<T>) -> T {
857854
unsafe {
@@ -866,14 +863,14 @@ impl<T> ManuallyDrop<T> {
866863
/// This function runs the destructor of the contained value and thus the wrapped value
867864
/// now represents uninitialized data. It is up to the user of this method to ensure the
868865
/// uninitialized data is not actually used.
869-
#[unstable(feature = "manually_drop", issue = "40673")]
866+
#[stable(feature = "manually_drop", since = "1.20.0")]
870867
#[inline]
871868
pub unsafe fn drop(slot: &mut ManuallyDrop<T>) {
872869
ptr::drop_in_place(&mut slot.value)
873870
}
874871
}
875872

876-
#[unstable(feature = "manually_drop", issue = "40673")]
873+
#[stable(feature = "manually_drop", since = "1.20.0")]
877874
impl<T> ::ops::Deref for ManuallyDrop<T> {
878875
type Target = T;
879876
#[inline]
@@ -884,7 +881,7 @@ impl<T> ::ops::Deref for ManuallyDrop<T> {
884881
}
885882
}
886883

887-
#[unstable(feature = "manually_drop", issue = "40673")]
884+
#[stable(feature = "manually_drop", since = "1.20.0")]
888885
impl<T> ::ops::DerefMut for ManuallyDrop<T> {
889886
#[inline]
890887
fn deref_mut(&mut self) -> &mut Self::Target {
@@ -894,7 +891,7 @@ impl<T> ::ops::DerefMut for ManuallyDrop<T> {
894891
}
895892
}
896893

897-
#[unstable(feature = "manually_drop", issue = "40673")]
894+
#[stable(feature = "manually_drop", since = "1.20.0")]
898895
impl<T: ::fmt::Debug> ::fmt::Debug for ManuallyDrop<T> {
899896
fn fmt(&self, fmt: &mut ::fmt::Formatter) -> ::fmt::Result {
900897
unsafe {

src/librustc_data_structures/lib.rs

Lines changed: 0 additions & 1 deletion
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)