diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 9d7f9ea8990..ab7030bee15 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -355,7 +355,6 @@ impl Arc { } } -#[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] impl Drop for Arc { /// Drops the `Arc`. @@ -489,7 +488,6 @@ impl Clone for Weak { } } -#[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] impl Drop for Weak { /// Drops the `Weak`. diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index a8be63d6373..c0974dcb2a0 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -73,7 +73,7 @@ #![feature(allocator)] #![feature(custom_attribute)] #![feature(fundamental)] -#![feature(lang_items, unsafe_destructor)] +#![feature(lang_items)] #![feature(box_syntax)] #![feature(optin_builtin_traits)] #![feature(unboxed_closures)] diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 2ee229ab1df..015d0330ed7 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -375,7 +375,6 @@ impl Deref for Rc { } } -#[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] impl Drop for Rc { /// Drops the `Rc`. @@ -693,7 +692,6 @@ impl Weak { } } -#[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] impl Drop for Weak { /// Drops the `Weak`. diff --git a/src/libarena/lib.rs b/src/libarena/lib.rs index e190fb42226..adfcca14d8d 100644 --- a/src/libarena/lib.rs +++ b/src/libarena/lib.rs @@ -35,7 +35,6 @@ #![feature(core)] #![feature(staged_api)] #![feature(unboxed_closures)] -#![feature(unsafe_destructor)] #![cfg_attr(test, feature(test))] extern crate alloc; @@ -124,7 +123,6 @@ fn chunk(size: usize, is_copy: bool) -> Chunk { } } -#[unsafe_destructor] impl<'longer_than_self> Drop for Arena<'longer_than_self> { fn drop(&mut self) { unsafe { @@ -510,7 +508,6 @@ impl TypedArena { } } -#[unsafe_destructor] impl Drop for TypedArena { fn drop(&mut self) { unsafe { diff --git a/src/libcollections/btree/node.rs b/src/libcollections/btree/node.rs index a480335c946..bca0e1427e4 100644 --- a/src/libcollections/btree/node.rs +++ b/src/libcollections/btree/node.rs @@ -270,14 +270,12 @@ impl DoubleEndedIterator for RawItems { } } -#[unsafe_destructor] impl Drop for RawItems { fn drop(&mut self) { for _ in self.by_ref() {} } } -#[unsafe_destructor] impl Drop for Node { fn drop(&mut self) { if self.keys.is_null() || @@ -1394,7 +1392,6 @@ impl TraversalImpl for MoveTraversalImpl { } } -#[unsafe_destructor] impl Drop for MoveTraversalImpl { fn drop(&mut self) { // We need to cleanup the stored values manually, as the RawItems destructor would run diff --git a/src/libcollections/lib.rs b/src/libcollections/lib.rs index ae2ad7751aa..ecbe9369e78 100644 --- a/src/libcollections/lib.rs +++ b/src/libcollections/lib.rs @@ -33,7 +33,6 @@ #![feature(staged_api)] #![feature(unboxed_closures)] #![feature(unicode)] -#![feature(unsafe_destructor)] #![feature(unique)] #![feature(unsafe_no_drop_flag, filling_drop)] #![feature(step_by)] diff --git a/src/libcollections/linked_list.rs b/src/libcollections/linked_list.rs index c73a6f9b324..f6dc5cf7d90 100644 --- a/src/libcollections/linked_list.rs +++ b/src/libcollections/linked_list.rs @@ -624,7 +624,6 @@ impl LinkedList { } } -#[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] impl Drop for LinkedList { fn drop(&mut self) { diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index f42c48681a9..4f0b17a563b 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -1626,7 +1626,6 @@ impl<'a, T: Clone> Add<&'a [T]> for Vec { } } -#[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] impl Drop for Vec { fn drop(&mut self) { @@ -1808,7 +1807,6 @@ impl DoubleEndedIterator for IntoIter { #[stable(feature = "rust1", since = "1.0.0")] impl ExactSizeIterator for IntoIter {} -#[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] impl Drop for IntoIter { fn drop(&mut self) { @@ -1867,7 +1865,6 @@ impl<'a, T> DoubleEndedIterator for Drain<'a, T> { } } -#[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] impl<'a, T> Drop for Drain<'a, T> { fn drop(&mut self) { @@ -1914,7 +1911,6 @@ impl<'a, T> Deref for DerefVec<'a, T> { } // Prevent the inner `Vec` from attempting to deallocate memory. -#[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] impl<'a, T> Drop for DerefVec<'a, T> { fn drop(&mut self) { @@ -1983,7 +1979,6 @@ struct PartialVecZeroSized { marker: PhantomData<::core::cell::Cell<(T,U)>>, } -#[unsafe_destructor] impl Drop for PartialVecNonZeroSized { fn drop(&mut self) { unsafe { @@ -2009,7 +2004,6 @@ impl Drop for PartialVecNonZeroSized { } } -#[unsafe_destructor] impl Drop for PartialVecZeroSized { fn drop(&mut self) { unsafe { diff --git a/src/libcollections/vec_deque.rs b/src/libcollections/vec_deque.rs index 61369b30dea..3032b13855b 100644 --- a/src/libcollections/vec_deque.rs +++ b/src/libcollections/vec_deque.rs @@ -59,7 +59,6 @@ impl Clone for VecDeque { } } -#[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] impl Drop for VecDeque { fn drop(&mut self) { @@ -1612,7 +1611,6 @@ pub struct Drain<'a, T: 'a> { inner: &'a mut VecDeque, } -#[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] impl<'a, T: 'a> Drop for Drain<'a, T> { fn drop(&mut self) { diff --git a/src/libcollectionstest/lib.rs b/src/libcollectionstest/lib.rs index 935cfb762c2..57a95633b67 100644 --- a/src/libcollectionstest/lib.rs +++ b/src/libcollectionstest/lib.rs @@ -18,7 +18,6 @@ #![feature(test)] #![feature(unboxed_closures)] #![feature(unicode)] -#![feature(unsafe_destructor)] #![feature(into_cow)] #![feature(step_by)] #![cfg_attr(test, feature(str_char))] diff --git a/src/libcollectionstest/vec.rs b/src/libcollectionstest/vec.rs index 7d3b156a7cc..8a8da0d9faa 100644 --- a/src/libcollectionstest/vec.rs +++ b/src/libcollectionstest/vec.rs @@ -18,7 +18,6 @@ struct DropCounter<'a> { count: &'a mut u32 } -#[unsafe_destructor] impl<'a> Drop for DropCounter<'a> { fn drop(&mut self) { *self.count += 1; diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index b4b25258bbf..9ff447a87f1 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -493,7 +493,6 @@ impl<'b> BorrowRef<'b> { } } -#[unsafe_destructor] impl<'b> Drop for BorrowRef<'b> { #[inline] fn drop(&mut self) { @@ -557,7 +556,6 @@ struct BorrowRefMut<'b> { _borrow: &'b Cell, } -#[unsafe_destructor] impl<'b> Drop for BorrowRefMut<'b> { #[inline] fn drop(&mut self) { diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs index 0178b321e88..73778bfd038 100644 --- a/src/libcore/fmt/mod.rs +++ b/src/libcore/fmt/mod.rs @@ -34,8 +34,7 @@ mod num; mod float; mod builders; -#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] -#[cfg_attr(not(stage0), unstable(feature = "core", reason = "internal to format_args!"))] +#[unstable(feature = "core", reason = "internal to format_args!")] #[doc(hidden)] pub mod rt { pub mod v1; @@ -148,8 +147,7 @@ enum Void {} /// compile time it is ensured that the function and the value have the correct /// types, and then this struct is used to canonicalize arguments to one type. #[derive(Copy)] -#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] -#[cfg_attr(not(stage0), unstable(feature = "core", reason = "internal to format_args!"))] +#[unstable(feature = "core", reason = "internal to format_args!")] #[doc(hidden)] pub struct ArgumentV1<'a> { value: &'a Void, @@ -169,8 +167,7 @@ impl<'a> ArgumentV1<'a> { } #[doc(hidden)] - #[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] - #[cfg_attr(not(stage0), unstable(feature = "core", reason = "internal to format_args!"))] + #[unstable(feature = "core", reason = "internal to format_args!")] pub fn new<'b, T>(x: &'b T, f: fn(&T, &mut Formatter) -> Result) -> ArgumentV1<'b> { unsafe { @@ -182,8 +179,7 @@ impl<'a> ArgumentV1<'a> { } #[doc(hidden)] - #[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] - #[cfg_attr(not(stage0), unstable(feature = "core", reason = "internal to format_args!"))] + #[unstable(feature = "core", reason = "internal to format_args!")] pub fn from_usize(x: &usize) -> ArgumentV1 { ArgumentV1::new(x, ArgumentV1::show_usize) } @@ -206,8 +202,7 @@ impl<'a> Arguments<'a> { /// When using the format_args!() macro, this function is used to generate the /// Arguments structure. #[doc(hidden)] #[inline] - #[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] - #[cfg_attr(not(stage0), unstable(feature = "core", reason = "internal to format_args!"))] + #[unstable(feature = "core", reason = "internal to format_args!")] pub fn new_v1(pieces: &'a [&'a str], args: &'a [ArgumentV1<'a>]) -> Arguments<'a> { Arguments { @@ -224,8 +219,7 @@ impl<'a> Arguments<'a> { /// created with `argumentusize`. However, failing to do so doesn't cause /// unsafety, but will ignore invalid . #[doc(hidden)] #[inline] - #[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] - #[cfg_attr(not(stage0), unstable(feature = "core", reason = "internal to format_args!"))] + #[unstable(feature = "core", reason = "internal to format_args!")] pub fn new_v1_formatted(pieces: &'a [&'a str], args: &'a [ArgumentV1<'a>], fmt: &'a [rt::v1::Argument]) -> Arguments<'a> { diff --git a/src/libcore/fmt/rt/v1.rs b/src/libcore/fmt/rt/v1.rs index 0d851c1e897..2afd8abeb31 100644 --- a/src/libcore/fmt/rt/v1.rs +++ b/src/libcore/fmt/rt/v1.rs @@ -14,69 +14,46 @@ //! These definitions are similar to their `ct` equivalents, but differ in that //! these can be statically allocated and are slightly optimized for the runtime -#![cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] -#![cfg_attr(not(stage0), unstable(feature = "core", reason = "internal to format_args!"))] +#![unstable(feature = "core", reason = "internal to format_args!")] #[derive(Copy, Clone)] -#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] pub struct Argument { - #[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] pub position: Position, - #[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] pub format: FormatSpec, } #[derive(Copy, Clone)] -#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] pub struct FormatSpec { - #[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] pub fill: char, - #[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] pub align: Alignment, - #[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] pub flags: u32, - #[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] pub precision: Count, - #[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] pub width: Count, } /// Possible alignments that can be requested as part of a formatting directive. #[derive(Copy, Clone, PartialEq)] -#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] pub enum Alignment { /// Indication that contents should be left-aligned. - #[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] Left, /// Indication that contents should be right-aligned. - #[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] Right, /// Indication that contents should be center-aligned. - #[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] Center, /// No alignment was requested. - #[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] Unknown, } #[derive(Copy, Clone)] -#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] pub enum Count { - #[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] Is(usize), - #[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] Param(usize), - #[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] NextParam, - #[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] Implied, } #[derive(Copy, Clone)] -#[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] pub enum Position { - #[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] Next, - #[cfg_attr(stage0, stable(feature = "rust1", since = "1.0.0"))] At(usize) } diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index 8ed89adec5b..9c6a293f421 100644 --- a/src/libcore/intrinsics.rs +++ b/src/libcore/intrinsics.rs @@ -303,14 +303,8 @@ extern "rust-intrinsic" { /// } /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[cfg(not(stage0))] pub fn copy_nonoverlapping(src: *const T, dst: *mut T, count: usize); - /// dox - #[stable(feature = "rust1", since = "1.0.0")] - #[cfg(stage0)] - pub fn copy_nonoverlapping(dst: *mut T, src: *const T, count: usize); - /// Copies `count * size_of` bytes from `src` to `dst`. The source /// and destination may overlap. /// @@ -340,14 +334,8 @@ extern "rust-intrinsic" { /// ``` /// #[stable(feature = "rust1", since = "1.0.0")] - #[cfg(not(stage0))] pub fn copy(src: *const T, dst: *mut T, count: usize); - /// dox - #[stable(feature = "rust1", since = "1.0.0")] - #[cfg(stage0)] - pub fn copy(dst: *mut T, src: *const T, count: usize); - /// Invokes memset on the specified pointer, setting `count * size_of::()` /// bytes of memory starting at `dst` to `c`. #[stable(feature = "rust1", since = "1.0.0")] @@ -572,7 +560,5 @@ extern "rust-intrinsic" { /// Returns the value of the discriminant for the variant in 'v', /// cast to a `u64`; if `T` has no discriminant, returns 0. - // SNAP 5520801 - #[cfg(not(stage0))] pub fn discriminant_value(v: &T) -> u64; } diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index 249f0a0c389..dd06c3d0987 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -65,7 +65,7 @@ #![feature(intrinsics, lang_items)] #![feature(on_unimplemented)] -#![feature(simd, unsafe_destructor)] +#![feature(simd)] #![feature(staged_api)] #![feature(unboxed_closures)] #![feature(rustc_attrs)] diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs index fdabdbc5ed4..44e5390098b 100644 --- a/src/libcore/marker.rs +++ b/src/libcore/marker.rs @@ -35,20 +35,10 @@ use hash::Hasher; #[stable(feature = "rust1", since = "1.0.0")] #[lang="send"] #[rustc_on_unimplemented = "`{Self}` cannot be sent between threads safely"] -#[cfg(not(stage0))] pub unsafe trait Send { // empty. } -/// Types able to be transferred across thread boundaries. -#[stable(feature = "rust1", since = "1.0.0")] -#[lang="send"] -#[rustc_on_unimplemented = "`{Self}` cannot be sent between threads safely"] -#[cfg(stage0)] -pub unsafe trait Send : MarkerTrait { - // empty. -} - unsafe impl Send for .. { } impl !Send for *const T { } @@ -60,21 +50,10 @@ impl !Send for Managed { } #[lang="sized"] #[rustc_on_unimplemented = "`{Self}` does not have a constant size known at compile-time"] #[fundamental] // for Default, for example, which requires that `[T]: !Default` be evaluatable -#[cfg(not(stage0))] pub trait Sized { // Empty. } -/// Types with a constant size known at compile-time. -#[stable(feature = "rust1", since = "1.0.0")] -#[lang="sized"] -#[rustc_on_unimplemented = "`{Self}` does not have a constant size known at compile-time"] -#[fundamental] // for Default, for example, which requires that `[T]: !Default` be evaluatable -#[cfg(stage0)] -pub trait Sized : MarkerTrait { - // Empty. -} - /// Types that can be copied by simply copying bits (i.e. `memcpy`). /// /// By default, variable bindings have 'move semantics.' In other @@ -222,7 +201,6 @@ pub trait Copy : Clone { /// wrapper around the value(s) which can be mutated when behind a `&` /// reference; not doing this is undefined behaviour (for example, /// `transmute`-ing from `&T` to `&mut T` is illegal). -#[cfg(not(stage0))] #[stable(feature = "rust1", since = "1.0.0")] #[lang="sync"] #[rustc_on_unimplemented = "`{Self}` cannot be shared between threads safely"] @@ -230,15 +208,6 @@ pub unsafe trait Sync { // Empty } -/// dox -#[cfg(stage0)] -#[stable(feature = "rust1", since = "1.0.0")] -#[lang="sync"] -#[rustc_on_unimplemented = "`{Self}` cannot be shared between threads safely"] -pub unsafe trait Sync : MarkerTrait { - // Empty -} - unsafe impl Sync for .. { } impl !Sync for *const T { } @@ -301,20 +270,6 @@ macro_rules! impls{ ) } -/// dox -#[stable(feature = "rust1", since = "1.0.0")] -#[cfg(stage0)] -pub trait MarkerTrait : PhantomFn { } - -#[cfg(stage0)] -impl MarkerTrait for T {} - -/// dox -#[lang="phantom_fn"] -#[cfg(stage0)] -pub trait PhantomFn { -} - /// `PhantomData` allows you to describe that a type acts as if it stores a value of type `T`, /// even though it does not. This allows you to inform the compiler about certain safety properties /// of your code. @@ -461,14 +416,6 @@ mod impls { #[rustc_reflect_like] #[unstable(feature = "core", reason = "requires RFC and more experience")] #[allow(deprecated)] -#[cfg(not(stage0))] pub trait Reflect {} -/// dox -#[rustc_reflect_like] -#[unstable(feature = "core", reason = "requires RFC and more experience")] -#[cfg(stage0)] -pub trait Reflect: MarkerTrait {} - impl Reflect for .. { } - diff --git a/src/libcore/nonzero.rs b/src/libcore/nonzero.rs index 9ea44c39fe9..640703ca2f9 100644 --- a/src/libcore/nonzero.rs +++ b/src/libcore/nonzero.rs @@ -12,16 +12,10 @@ use marker::Sized; use ops::Deref; -#[cfg(stage0)] use marker::MarkerTrait; /// Unsafe trait to indicate what types are usable with the NonZero struct -#[cfg(not(stage0))] pub unsafe trait Zeroable {} -/// Unsafe trait to indicate what types are usable with the NonZero struct -#[cfg(stage0)] -pub unsafe trait Zeroable: MarkerTrait {} - unsafe impl Zeroable for *const T {} unsafe impl Zeroable for *mut T {} unsafe impl Zeroable for isize {} diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs index adfbd14121f..8a4f603ec47 100644 --- a/src/libcore/ops.rs +++ b/src/libcore/ops.rs @@ -508,8 +508,6 @@ macro_rules! neg_impl_numeric { macro_rules! neg_impl_unsigned { ($($t:ty)*) => { neg_impl_core!{ x => { - #[cfg(stage0)] - use ::num::wrapping::WrappingOps; !x.wrapping_add(1) }, $($t)*} } } @@ -1162,7 +1160,6 @@ pub trait FnOnce { extern "rust-call" fn call_once(self, args: Args) -> Self::Output; } -#[cfg(not(stage0))] mod impls { use marker::Sized; use super::{Fn, FnMut, FnOnce}; diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index 0e9570df09d..00326ecd3e7 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -106,28 +106,11 @@ use cmp::Ordering::{self, Less, Equal, Greater}; // FIXME #19649: intrinsic docs don't render, so these have no docs :( #[stable(feature = "rust1", since = "1.0.0")] -#[cfg(not(stage0))] pub use intrinsics::copy_nonoverlapping; -/// dox -#[cfg(stage0)] #[stable(feature = "rust1", since = "1.0.0")] -pub unsafe fn copy_nonoverlapping(src: *const T, dst: *mut T, count: usize) { - intrinsics::copy_nonoverlapping(dst, src, count) -} - -#[stable(feature = "rust1", since = "1.0.0")] -#[cfg(not(stage0))] pub use intrinsics::copy; -/// dox -#[cfg(stage0)] -#[stable(feature = "rust1", since = "1.0.0")] -pub unsafe fn copy(src: *const T, dst: *mut T, count: usize) { - intrinsics::copy(dst, src, count) -} - - #[stable(feature = "rust1", since = "1.0.0")] pub use intrinsics::write_bytes; diff --git a/src/libcoretest/lib.rs b/src/libcoretest/lib.rs index e0e8e46af6c..15669722752 100644 --- a/src/libcoretest/lib.rs +++ b/src/libcoretest/lib.rs @@ -13,7 +13,6 @@ #![feature(box_syntax)] #![feature(unboxed_closures)] -#![feature(unsafe_destructor)] #![feature(core)] #![feature(test)] #![feature(rand)] diff --git a/src/libcoretest/option.rs b/src/libcoretest/option.rs index 569142c0d7d..ad096630127 100644 --- a/src/libcoretest/option.rs +++ b/src/libcoretest/option.rs @@ -44,8 +44,7 @@ fn test_get_resource() { i: Rc>, } - #[unsafe_destructor] - impl Drop for R { + impl Drop for R { fn drop(&mut self) { let ii = &*self.i; let i = *ii.borrow(); diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index d4012f2057b..767f17681b4 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -34,7 +34,6 @@ #![feature(quote)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] -#![feature(unsafe_destructor)] #![feature(staged_api)] #![feature(std_misc)] #![feature(path_ext)] diff --git a/src/librustc_borrowck/lib.rs b/src/librustc_borrowck/lib.rs index 647ea3555ba..8cecc528d1a 100644 --- a/src/librustc_borrowck/lib.rs +++ b/src/librustc_borrowck/lib.rs @@ -25,7 +25,6 @@ #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] #![feature(staged_api)] -#![feature(unsafe_destructor)] #![feature(into_cow)] #[macro_use] extern crate log; diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index 38217f8dad2..75673a6b83a 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -31,7 +31,6 @@ #![feature(quote)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] -#![feature(unsafe_destructor)] #![feature(staged_api)] #![feature(exit_status)] #![feature(set_stdio)] diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs index 34f7436d0cd..544fe759819 100644 --- a/src/librustc_lint/lib.rs +++ b/src/librustc_lint/lib.rs @@ -37,7 +37,6 @@ #![feature(quote)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] -#![feature(unsafe_destructor)] #![feature(staged_api)] #![feature(str_char)] #![cfg_attr(test, feature(test))] diff --git a/src/librustc_llvm/archive_ro.rs b/src/librustc_llvm/archive_ro.rs index c8f3e204c4e..b591e37f893 100644 --- a/src/librustc_llvm/archive_ro.rs +++ b/src/librustc_llvm/archive_ro.rs @@ -105,7 +105,6 @@ impl<'a> Iterator for Iter<'a> { } } -#[unsafe_destructor] impl<'a> Drop for Iter<'a> { fn drop(&mut self) { unsafe { diff --git a/src/librustc_llvm/lib.rs b/src/librustc_llvm/lib.rs index 80e01154655..22f915af00f 100644 --- a/src/librustc_llvm/lib.rs +++ b/src/librustc_llvm/lib.rs @@ -30,7 +30,6 @@ #![feature(libc)] #![feature(link_args)] #![feature(staged_api)] -#![feature(unsafe_destructor)] extern crate libc; #[macro_use] #[no_link] extern crate rustc_bitflags; diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs index b0eacd1a55d..3e2db80a9c5 100644 --- a/src/librustc_trans/lib.rs +++ b/src/librustc_trans/lib.rs @@ -34,7 +34,6 @@ #![feature(quote)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] -#![feature(unsafe_destructor)] #![feature(staged_api)] #![feature(unicode)] #![feature(path_ext)] diff --git a/src/librustc_trans/trans/base.rs b/src/librustc_trans/trans/base.rs index 1e5b4d4d5ff..a049b9a4e49 100644 --- a/src/librustc_trans/trans/base.rs +++ b/src/librustc_trans/trans/base.rs @@ -125,7 +125,6 @@ pub struct _InsnCtxt { _cannot_construct_outside_of_this_module: () } -#[unsafe_destructor] impl Drop for _InsnCtxt { fn drop(&mut self) { TASK_LOCAL_INSN_KEY.with(|slot| { @@ -166,7 +165,6 @@ impl<'a, 'tcx> StatRecorder<'a, 'tcx> { } } -#[unsafe_destructor] impl<'a, 'tcx> Drop for StatRecorder<'a, 'tcx> { fn drop(&mut self) { if self.ccx.sess().trans_stats() { diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index be3fc860b2b..20827f2ddfb 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -82,7 +82,6 @@ This API is completely unstable and subject to change. #![feature(quote)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] -#![feature(unsafe_destructor)] #![feature(staged_api)] #[macro_use] extern crate log; diff --git a/src/libstd/collections/hash/table.rs b/src/libstd/collections/hash/table.rs index 3a63e2ab59c..4841f36c7f7 100644 --- a/src/libstd/collections/hash/table.rs +++ b/src/libstd/collections/hash/table.rs @@ -943,7 +943,6 @@ impl<'a, K, V> ExactSizeIterator for Drain<'a, K, V> { fn len(&self) -> usize { self.table.size() } } -#[unsafe_destructor] impl<'a, K: 'a, V: 'a> Drop for Drain<'a, K, V> { fn drop(&mut self) { for _ in self.by_ref() {} @@ -986,7 +985,6 @@ impl Clone for RawTable { } } -#[unsafe_destructor] impl Drop for RawTable { fn drop(&mut self) { if self.capacity == 0 || self.capacity == mem::POST_DROP_USIZE { diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs index 67cac42c35e..ed6023b2b81 100644 --- a/src/libstd/io/buffered.rs +++ b/src/libstd/io/buffered.rs @@ -292,7 +292,6 @@ impl Seek for BufWriter { } } -#[unsafe_destructor] impl Drop for BufWriter { fn drop(&mut self) { if self.inner.is_some() { diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index e8d15a95b80..561c37ad950 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -70,8 +70,7 @@ fn append_to_string(buf: &mut String, f: F) -> Result where F: FnOnce(&mut Vec) -> Result { struct Guard<'a> { s: &'a mut Vec, len: usize } - #[unsafe_destructor] - impl<'a> Drop for Guard<'a> { + impl<'a> Drop for Guard<'a> { fn drop(&mut self) { unsafe { self.s.set_len(self.len); } } diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 96665259a4d..8473b24172e 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -118,7 +118,6 @@ #![feature(staged_api)] #![feature(unboxed_closures)] #![feature(unicode)] -#![feature(unsafe_destructor)] #![feature(unsafe_no_drop_flag, filling_drop)] #![feature(macro_reexport)] #![feature(unique)] diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index f3e99a8541a..fcebe9c5e98 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -38,30 +38,6 @@ #[macro_export] #[stable(feature = "rust1", since = "1.0.0")] #[allow_internal_unstable] -#[cfg(stage0)] -macro_rules! panic { - () => ({ - panic!("explicit panic") - }); - ($msg:expr) => ({ - $crate::rt::begin_unwind($msg, { - // static requires less code at runtime, more constant data - static _FILE_LINE: (&'static str, usize) = (file!(), line!() as usize); - &_FILE_LINE - }) - }); - ($fmt:expr, $($arg:tt)+) => ({ - $crate::rt::begin_unwind_fmt(format_args!($fmt, $($arg)+), { - // The leading _'s are to avoid dead code warnings if this is - // used inside a dead function. Just `#[allow(dead_code)]` is - // insufficient, since the user may have - // `#[forbid(dead_code)]` and which cannot be overridden. - static _FILE_LINE: (&'static str, u32) = (file!(), line!()); - &_FILE_LINE - }) - }); -} - /// The entry point for panic of Rust tasks. /// /// This macro is used to inject panic into a Rust task, causing the task to @@ -84,7 +60,6 @@ macro_rules! panic { #[macro_export] #[stable(feature = "rust1", since = "1.0.0")] #[allow_internal_unstable] -#[cfg(not(stage0))] macro_rules! panic { () => ({ panic!("explicit panic") diff --git a/src/libstd/rt/unwind.rs b/src/libstd/rt/unwind.rs index c880aae80fc..a764b99e280 100644 --- a/src/libstd/rt/unwind.rs +++ b/src/libstd/rt/unwind.rs @@ -510,23 +510,6 @@ pub fn begin_unwind_fmt(msg: fmt::Arguments, file_line: &(&'static str, u32)) -> /// This is the entry point of unwinding for panic!() and assert!(). #[inline(never)] #[cold] // avoid code bloat at the call sites as much as possible -#[cfg(stage0)] -pub fn begin_unwind(msg: M, file_line: &(&'static str, usize)) -> ! { - // Note that this should be the only allocation performed in this code path. - // Currently this means that panic!() on OOM will invoke this code path, - // but then again we're not really ready for panic on OOM anyway. If - // we do start doing this, then we should propagate this allocation to - // be performed in the parent of this thread instead of the thread that's - // panicking. - - // see below for why we do the `Any` coercion here. - let (file, line) = *file_line; - begin_unwind_inner(Box::new(msg), &(file, line as u32)) -} - -/// This is the entry point of unwinding for panic!() and assert!(). -#[inline(never)] #[cold] // avoid code bloat at the call sites as much as possible -#[cfg(not(stage0))] pub fn begin_unwind(msg: M, file_line: &(&'static str, u32)) -> ! { // Note that this should be the only allocation performed in this code path. // Currently this means that panic!() on OOM will invoke this code path, diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index 74e85db1a06..61932225d79 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -619,7 +619,6 @@ impl Clone for Sender { } } -#[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] impl Drop for Sender { fn drop(&mut self) { @@ -683,7 +682,6 @@ impl Clone for SyncSender { } } -#[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] impl Drop for SyncSender { fn drop(&mut self) { @@ -930,7 +928,6 @@ impl IntoIterator for Receiver { } } -#[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] impl Drop for Receiver { fn drop(&mut self) { diff --git a/src/libstd/sync/mpsc/mpsc_queue.rs b/src/libstd/sync/mpsc/mpsc_queue.rs index 9b6c8f4dd97..4ab5a796fcb 100644 --- a/src/libstd/sync/mpsc/mpsc_queue.rs +++ b/src/libstd/sync/mpsc/mpsc_queue.rs @@ -138,7 +138,6 @@ impl Queue { } } -#[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] impl Drop for Queue { fn drop(&mut self) { diff --git a/src/libstd/sync/mpsc/oneshot.rs b/src/libstd/sync/mpsc/oneshot.rs index c6e8d87a22e..ab45b722c45 100644 --- a/src/libstd/sync/mpsc/oneshot.rs +++ b/src/libstd/sync/mpsc/oneshot.rs @@ -367,7 +367,6 @@ impl Packet { } } -#[unsafe_destructor] impl Drop for Packet { fn drop(&mut self) { assert_eq!(self.state.load(Ordering::SeqCst), DISCONNECTED); diff --git a/src/libstd/sync/mpsc/select.rs b/src/libstd/sync/mpsc/select.rs index 58f16a83ba9..fde99e11040 100644 --- a/src/libstd/sync/mpsc/select.rs +++ b/src/libstd/sync/mpsc/select.rs @@ -315,7 +315,6 @@ impl<'rx, T: Send> Handle<'rx, T> { } } -#[unsafe_destructor] impl Drop for Select { fn drop(&mut self) { assert!(self.head.is_null()); @@ -323,7 +322,6 @@ impl Drop for Select { } } -#[unsafe_destructor] impl<'rx, T: Send> Drop for Handle<'rx, T> { fn drop(&mut self) { unsafe { self.remove() } diff --git a/src/libstd/sync/mpsc/shared.rs b/src/libstd/sync/mpsc/shared.rs index 5c1610bdc31..09a02923f14 100644 --- a/src/libstd/sync/mpsc/shared.rs +++ b/src/libstd/sync/mpsc/shared.rs @@ -473,7 +473,6 @@ impl Packet { } } -#[unsafe_destructor] impl Drop for Packet { fn drop(&mut self) { // Note that this load is not only an assert for correctness about diff --git a/src/libstd/sync/mpsc/spsc_queue.rs b/src/libstd/sync/mpsc/spsc_queue.rs index 4dd84364fa8..f4b9c7d45fd 100644 --- a/src/libstd/sync/mpsc/spsc_queue.rs +++ b/src/libstd/sync/mpsc/spsc_queue.rs @@ -226,7 +226,6 @@ impl Queue { } } -#[unsafe_destructor] impl Drop for Queue { fn drop(&mut self) { unsafe { diff --git a/src/libstd/sync/mpsc/stream.rs b/src/libstd/sync/mpsc/stream.rs index f0363fae84f..1200e71d9af 100644 --- a/src/libstd/sync/mpsc/stream.rs +++ b/src/libstd/sync/mpsc/stream.rs @@ -471,7 +471,6 @@ impl Packet { } } -#[unsafe_destructor] impl Drop for Packet { fn drop(&mut self) { // Note that this load is not only an assert for correctness about diff --git a/src/libstd/sync/mpsc/sync.rs b/src/libstd/sync/mpsc/sync.rs index 6221ca59b54..4687df107f6 100644 --- a/src/libstd/sync/mpsc/sync.rs +++ b/src/libstd/sync/mpsc/sync.rs @@ -411,7 +411,6 @@ impl Packet { } } -#[unsafe_destructor] impl Drop for Packet { fn drop(&mut self) { assert_eq!(self.channels.load(Ordering::SeqCst), 0); diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs index caf011c54f2..30c7407a96d 100644 --- a/src/libstd/sync/mutex.rs +++ b/src/libstd/sync/mutex.rs @@ -244,7 +244,6 @@ impl Mutex { } } -#[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] impl Drop for Mutex { fn drop(&mut self) { @@ -340,7 +339,6 @@ impl<'mutex, T> DerefMut for MutexGuard<'mutex, T> { } } -#[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] impl<'a, T> Drop for MutexGuard<'a, T> { #[inline] diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs index 1ea92d5eff7..a133bb01b61 100644 --- a/src/libstd/sync/rwlock.rs +++ b/src/libstd/sync/rwlock.rs @@ -249,7 +249,6 @@ impl RwLock { } } -#[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] impl Drop for RwLock { fn drop(&mut self) { @@ -387,7 +386,6 @@ impl<'rwlock, T> DerefMut for RwLockWriteGuard<'rwlock, T> { } } -#[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] impl<'a, T> Drop for RwLockReadGuard<'a, T> { fn drop(&mut self) { @@ -395,7 +393,6 @@ impl<'a, T> Drop for RwLockReadGuard<'a, T> { } } -#[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] impl<'a, T> Drop for RwLockWriteGuard<'a, T> { fn drop(&mut self) { diff --git a/src/libstd/sync/semaphore.rs b/src/libstd/sync/semaphore.rs index be521095aa9..776b3c5064c 100644 --- a/src/libstd/sync/semaphore.rs +++ b/src/libstd/sync/semaphore.rs @@ -100,7 +100,6 @@ impl Semaphore { } } -#[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] impl<'a> Drop for SemaphoreGuard<'a> { fn drop(&mut self) { diff --git a/src/libstd/sys/common/remutex.rs b/src/libstd/sys/common/remutex.rs index 00238500c3a..48c74b8d89e 100644 --- a/src/libstd/sys/common/remutex.rs +++ b/src/libstd/sys/common/remutex.rs @@ -96,7 +96,6 @@ impl ReentrantMutex { } } -#[unsafe_destructor] impl Drop for ReentrantMutex { fn drop(&mut self) { // This is actually safe b/c we know that there is no further usage of @@ -138,7 +137,6 @@ impl<'mutex, T> Deref for ReentrantMutexGuard<'mutex, T> { } } -#[unsafe_destructor] impl<'a, T> Drop for ReentrantMutexGuard<'a, T> { #[inline] fn drop(&mut self) { diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index ce531fb1381..ae480380f95 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -700,7 +700,6 @@ impl<'a, T: Send + 'a> JoinGuard<'a, T> { } } -#[unsafe_destructor] #[unstable(feature = "scoped", reason = "memory unsafe if destructor is avoided, see #24292")] impl<'a, T: Send + 'a> Drop for JoinGuard<'a, T> { diff --git a/src/libstd/thread/scoped_tls.rs b/src/libstd/thread/scoped_tls.rs index 9c0b4a5d833..35684a1f390 100644 --- a/src/libstd/thread/scoped_tls.rs +++ b/src/libstd/thread/scoped_tls.rs @@ -171,8 +171,7 @@ impl ScopedKey { key: &'a __impl::KeyInner, val: *mut T, } - #[unsafe_destructor] - impl<'a, T> Drop for Reset<'a, T> { + impl<'a, T> Drop for Reset<'a, T> { fn drop(&mut self) { unsafe { self.key.set(self.val) } } diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 60b1d4797d5..28deb4eec3f 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -93,10 +93,6 @@ const KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[ ("fundamental", "1.0.0", Active), - // Deprecate after snapshot - // SNAP 5520801 - ("unsafe_destructor", "1.0.0", Active), - // A temporary feature gate used to enable parser extensions needed // to bootstrap fix for #5723. ("issue_5723_bootstrap", "1.0.0", Accepted), @@ -209,8 +205,6 @@ pub const KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType)] = &[ ("link_args", Normal), ("macro_escape", Normal), - ("unsafe_destructor", Gated("unsafe_destructor", - "`#[unsafe_destructor]` does nothing anymore")), ("staged_api", Gated("staged_api", "staged_api is for use by rustc only")), ("plugin", Gated("plugin", diff --git a/src/snapshots.txt b/src/snapshots.txt index 5d265478b64..7c4b3866b2a 100644 --- a/src/snapshots.txt +++ b/src/snapshots.txt @@ -1,3 +1,13 @@ +S 2015-04-27 857ef6e + bitrig-x86_64 d28e2a5f8b478e69720703e751774f5e728a8edd + freebsd-x86_64 18925db56f6298cc190d1f41615ab5871de1dda0 + linux-i386 0bc8cffdce611fb71fd7d3d8e7cdbfaf748a4f16 + linux-x86_64 94089740e48167c5975c92c139ae9c286764012f + macos-i386 54cc35e76497e6e94fddf38d6e40e9d168491ddb + macos-x86_64 43a1c1fba0d1dfee4c2ca310d506f8f5f51b3f6f + winnt-i386 3db3adf2eaf37075043ec4ee41a5ea9b88810c44 + winnt-x86_64 82b6eaea67741517ce6d7901ad2a9fd223c3aaf1 + S 2015-03-27 5520801 bitrig-x86_64 55a69b0ae5481ccda54c2fcfc54025a0945c4f57 freebsd-x86_64 0910bbad35e213f679d0433884fd51398eb3bc8d diff --git a/src/test/auxiliary/issue-2526.rs b/src/test/auxiliary/issue-2526.rs index e85a0a90aff..e57c6dc7184 100644 --- a/src/test/auxiliary/issue-2526.rs +++ b/src/test/auxiliary/issue-2526.rs @@ -11,8 +11,6 @@ #![crate_name="issue_2526"] #![crate_type = "lib"] -#![feature(unsafe_destructor)] - use std::marker; struct arc_destruct { @@ -20,7 +18,6 @@ struct arc_destruct { _marker: marker::PhantomData } -#[unsafe_destructor] impl Drop for arc_destruct { fn drop(&mut self) {} } diff --git a/src/test/bench/task-perf-alloc-unwind.rs b/src/test/bench/task-perf-alloc-unwind.rs index 9eba2c36390..e091dbfb00e 100644 --- a/src/test/bench/task-perf-alloc-unwind.rs +++ b/src/test/bench/task-perf-alloc-unwind.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unsafe_destructor, box_syntax, std_misc, collections)] +#![feature(box_syntax, std_misc, collections)] use std::env; use std::thread; @@ -54,7 +54,6 @@ struct r { _l: Box, } -#[unsafe_destructor] impl Drop for r { fn drop(&mut self) {} } diff --git a/src/test/compile-fail/borrowck-borrowed-uniq-rvalue-2.rs b/src/test/compile-fail/borrowck-borrowed-uniq-rvalue-2.rs index 99ac8672269..309e286f48e 100644 --- a/src/test/compile-fail/borrowck-borrowed-uniq-rvalue-2.rs +++ b/src/test/compile-fail/borrowck-borrowed-uniq-rvalue-2.rs @@ -8,13 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unsafe_destructor)] - struct defer<'a> { x: &'a [&'a str], } -#[unsafe_destructor] impl<'a> Drop for defer<'a> { fn drop(&mut self) { unsafe { diff --git a/src/test/compile-fail/dropck_arr_cycle_checked.rs b/src/test/compile-fail/dropck_arr_cycle_checked.rs index 40d992fe21f..f3c3f31e4af 100644 --- a/src/test/compile-fail/dropck_arr_cycle_checked.rs +++ b/src/test/compile-fail/dropck_arr_cycle_checked.rs @@ -13,8 +13,6 @@ // // (Compare against compile-fail/dropck_vec_cycle_checked.rs) -#![feature(unsafe_destructor)] - use std::cell::Cell; use id::Id; @@ -69,7 +67,6 @@ struct CheckId { #[allow(non_snake_case)] fn CheckId(t: T) -> CheckId { CheckId{ v: t } } -#[unsafe_destructor] impl Drop for CheckId { fn drop(&mut self) { assert!(self.v.count() > 0); diff --git a/src/test/compile-fail/dropck_direct_cycle_with_drop.rs b/src/test/compile-fail/dropck_direct_cycle_with_drop.rs index b9df71322ad..5db23721259 100644 --- a/src/test/compile-fail/dropck_direct_cycle_with_drop.rs +++ b/src/test/compile-fail/dropck_direct_cycle_with_drop.rs @@ -23,8 +23,6 @@ // `'a` in `&'a D<'a>` cannot be satisfied when `D<'a>` implements // `Drop`.) -#![feature(unsafe_destructor)] - use std::cell::Cell; struct D<'a> { @@ -36,7 +34,6 @@ impl<'a> D<'a> { fn new(name: String) -> D<'a> { D { name: name, p: Cell::new(None) } } } -#[unsafe_destructor] impl<'a> Drop for D<'a> { fn drop(&mut self) { println!("dropping {} whose sibling is {:?}", diff --git a/src/test/compile-fail/dropck_tarena_cycle_checked.rs b/src/test/compile-fail/dropck_tarena_cycle_checked.rs index 9488882ca94..10bfe70640c 100644 --- a/src/test/compile-fail/dropck_tarena_cycle_checked.rs +++ b/src/test/compile-fail/dropck_tarena_cycle_checked.rs @@ -17,7 +17,6 @@ // for the error message we see here.) #![allow(unstable)] -#![feature(unsafe_destructor)] extern crate arena; @@ -76,7 +75,6 @@ struct CheckId { #[allow(non_snake_case)] fn CheckId(t: T) -> CheckId { CheckId{ v: t } } -#[unsafe_destructor] impl Drop for CheckId { fn drop(&mut self) { assert!(self.v.count() > 0); diff --git a/src/test/compile-fail/dropck_tarena_unsound_drop.rs b/src/test/compile-fail/dropck_tarena_unsound_drop.rs index 64d77e97fa7..7a204e6143e 100644 --- a/src/test/compile-fail/dropck_tarena_unsound_drop.rs +++ b/src/test/compile-fail/dropck_tarena_unsound_drop.rs @@ -20,7 +20,6 @@ // this was reduced to better understand its error message.) #![allow(unstable)] -#![feature(unsafe_destructor)] extern crate arena; @@ -35,7 +34,6 @@ struct CheckId { v: T } // interface to CheckId does not (and cannot) know that, and therefore // when encountering the a value V of type CheckId, we must // conservatively force the type S to strictly outlive V. -#[unsafe_destructor] impl Drop for CheckId { fn drop(&mut self) { assert!(self.v.count() > 0); diff --git a/src/test/compile-fail/dropck_vec_cycle_checked.rs b/src/test/compile-fail/dropck_vec_cycle_checked.rs index 9d92552244f..53a14fd8fac 100644 --- a/src/test/compile-fail/dropck_vec_cycle_checked.rs +++ b/src/test/compile-fail/dropck_vec_cycle_checked.rs @@ -12,8 +12,6 @@ // // (Compare against compile-fail/dropck_arr_cycle_checked.rs) -#![feature(unsafe_destructor)] - use std::cell::Cell; use id::Id; @@ -68,7 +66,6 @@ struct CheckId { #[allow(non_snake_case)] fn CheckId(t: T) -> CheckId { CheckId{ v: t } } -#[unsafe_destructor] impl Drop for CheckId { fn drop(&mut self) { assert!(self.v.count() > 0); diff --git a/src/test/compile-fail/exclusive-drop-and-copy.rs b/src/test/compile-fail/exclusive-drop-and-copy.rs index 460c396750f..b4cb2469659 100644 --- a/src/test/compile-fail/exclusive-drop-and-copy.rs +++ b/src/test/compile-fail/exclusive-drop-and-copy.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unsafe_destructor)] - // issue #20126 #[derive(Copy, Clone)] //~ ERROR the trait `Copy` may not be implemented @@ -22,7 +20,6 @@ impl Drop for Foo { #[derive(Copy, Clone)] //~ ERROR the trait `Copy` may not be implemented struct Bar(::std::marker::PhantomData); -#[unsafe_destructor] impl Drop for Bar { fn drop(&mut self) {} } diff --git a/src/test/compile-fail/gated-unsafe-destructor.rs b/src/test/compile-fail/gated-unsafe-destructor.rs deleted file mode 100644 index 9dd1e229e0a..00000000000 --- a/src/test/compile-fail/gated-unsafe-destructor.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2015 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Test that `#[unsafe_destructor]` attribute is gated by `unsafe_destructor` -// feature gate. -// -// (This test can be removed entirely when we remove the -// `unsafe_destructor` feature itself.) - -struct D<'a>(&'a u32); - -#[unsafe_destructor] -//~^ ERROR `#[unsafe_destructor]` does nothing anymore -impl<'a> Drop for D<'a> { - fn drop(&mut self) { } -} - -pub fn main() { } diff --git a/src/test/compile-fail/no-send-res-ports.rs b/src/test/compile-fail/no-send-res-ports.rs index 5ebc386109a..b80d15bb6f3 100644 --- a/src/test/compile-fail/no-send-res-ports.rs +++ b/src/test/compile-fail/no-send-res-ports.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unsafe_destructor)] - use std::thread; use std::rc::Rc; @@ -22,8 +20,7 @@ fn main() { _x: Port<()>, } - #[unsafe_destructor] - impl Drop for foo { + impl Drop for foo { fn drop(&mut self) {} } diff --git a/src/test/compile-fail/reject-specialized-drops-8142.rs b/src/test/compile-fail/reject-specialized-drops-8142.rs index 30264c9f218..1e189528f18 100644 --- a/src/test/compile-fail/reject-specialized-drops-8142.rs +++ b/src/test/compile-fail/reject-specialized-drops-8142.rs @@ -11,8 +11,6 @@ // Issue 8142: Test that Drop impls cannot be specialized beyond the // predicates attached to the struct/enum definition itself. -#![feature(unsafe_destructor)] - trait Bound { fn foo(&self) { } } struct K<'l1,'l2> { x: &'l1 i8, y: &'l2 u8 } struct L<'l1,'l2> { x: &'l1 i8, y: &'l2 u8 } @@ -28,51 +26,39 @@ struct U; struct V { x: *const Tva, y: *const Tvb } struct W<'l1, 'l2> { x: &'l1 i8, y: &'l2 u8 } -#[unsafe_destructor] impl<'al,'adds_bnd:'al> Drop for K<'al,'adds_bnd> { // REJECT //~^ ERROR The requirement `'adds_bnd : 'al` is added only by the Drop impl. fn drop(&mut self) { } } -#[unsafe_destructor] impl<'al,'adds_bnd> Drop for L<'al,'adds_bnd> where 'adds_bnd:'al { // REJECT //~^ ERROR The requirement `'adds_bnd : 'al` is added only by the Drop impl. fn drop(&mut self) { } } -#[unsafe_destructor] impl<'ml> Drop for M<'ml> { fn drop(&mut self) { } } // ACCEPT -#[unsafe_destructor] impl Drop for N<'static> { fn drop(&mut self) { } } // REJECT //~^ ERROR Implementations of Drop cannot be specialized -#[unsafe_destructor] impl Drop for O { fn drop(&mut self) { } } // ACCEPT -#[unsafe_destructor] impl Drop for P { fn drop(&mut self) { } } // REJECT //~^ ERROR Implementations of Drop cannot be specialized -#[unsafe_destructor] impl Drop for Q { fn drop(&mut self) { } } // REJECT //~^ ERROR The requirement `Adds_bnd : Bound` is added only by the Drop impl. -#[unsafe_destructor] impl<'rbnd,Adds_rbnd:'rbnd> Drop for R { fn drop(&mut self) { } } // REJECT //~^ ERROR The requirement `Adds_rbnd : 'rbnd` is added only by the Drop impl. -#[unsafe_destructor] impl Drop for S { fn drop(&mut self) { } } // ACCEPT -#[unsafe_destructor] impl<'t,Bt:'t> Drop for T<'t,Bt> { fn drop(&mut self) { } } // ACCEPT impl Drop for U { fn drop(&mut self) { } } // ACCEPT -#[unsafe_destructor] impl Drop for V { fn drop(&mut self) { } } // REJECT //~^ERROR Implementations of Drop cannot be specialized -#[unsafe_destructor] impl<'lw> Drop for W<'lw,'lw> { fn drop(&mut self) { } } // REJECT //~^ERROR Implementations of Drop cannot be specialized diff --git a/src/test/compile-fail/unique-vec-res.rs b/src/test/compile-fail/unique-vec-res.rs index 938abbf2c20..6aa0834cb27 100644 --- a/src/test/compile-fail/unique-vec-res.rs +++ b/src/test/compile-fail/unique-vec-res.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unsafe_destructor)] - use std::cell::Cell; #[derive(Debug)] @@ -17,7 +15,6 @@ struct r<'a> { i: &'a Cell, } -#[unsafe_destructor] impl<'a> Drop for r<'a> { fn drop(&mut self) { unsafe { diff --git a/src/test/compile-fail/vec-must-not-hide-type-from-dropck.rs b/src/test/compile-fail/vec-must-not-hide-type-from-dropck.rs index 44a3f716e3e..c30aa7b817b 100644 --- a/src/test/compile-fail/vec-must-not-hide-type-from-dropck.rs +++ b/src/test/compile-fail/vec-must-not-hide-type-from-dropck.rs @@ -23,8 +23,6 @@ // conditions above to be satisfied, meaning that if the dropck is // sound, it should reject this code. -#![feature(unsafe_destructor)] - use std::cell::Cell; use id::Id; @@ -91,7 +89,6 @@ struct CheckId { #[allow(non_snake_case)] fn CheckId(t: T) -> CheckId { CheckId{ v: t } } -#[unsafe_destructor] impl Drop for CheckId { fn drop(&mut self) { assert!(self.v.count() > 0); diff --git a/src/test/run-pass/attr-no-drop-flag-size.rs b/src/test/run-pass/attr-no-drop-flag-size.rs index 893fb85b529..0c464c9bad7 100644 --- a/src/test/run-pass/attr-no-drop-flag-size.rs +++ b/src/test/run-pass/attr-no-drop-flag-size.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - -#![feature(unsafe_destructor)] #![feature(unsafe_no_drop_flag)] use std::mem::size_of; @@ -19,7 +17,6 @@ struct Test { a: T } -#[unsafe_destructor] impl Drop for Test { fn drop(&mut self) { } } diff --git a/src/test/run-pass/drop-trait-generic.rs b/src/test/run-pass/drop-trait-generic.rs index 4ba3aa70dfc..e55eae1e74f 100644 --- a/src/test/run-pass/drop-trait-generic.rs +++ b/src/test/run-pass/drop-trait-generic.rs @@ -8,13 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unsafe_destructor)] - struct S { x: T } -#[unsafe_destructor] impl ::std::ops::Drop for S { fn drop(&mut self) { println!("bye"); diff --git a/src/test/run-pass/dropck_tarena_sound_drop.rs b/src/test/run-pass/dropck_tarena_sound_drop.rs index 6ccf6c2fd64..b0c4f4ca272 100644 --- a/src/test/run-pass/dropck_tarena_sound_drop.rs +++ b/src/test/run-pass/dropck_tarena_sound_drop.rs @@ -16,9 +16,8 @@ // shows a similar setup, but restricts `f` so that the struct `C<'a>` // is force-fed a lifetime equal to that of the borrowed arena. - #![allow(unstable)] -#![feature(unsafe_destructor, rustc_private)] +#![feature(rustc_private)] extern crate arena; @@ -33,7 +32,6 @@ struct CheckId { v: T } // interface to CheckId does not (and cannot) know that, and therefore // when encountering the a value V of type CheckId, we must // conservatively force the type S to strictly outlive V. -#[unsafe_destructor] impl Drop for CheckId { fn drop(&mut self) { assert!(self.v.count() > 0); diff --git a/src/test/run-pass/init-res-into-things.rs b/src/test/run-pass/init-res-into-things.rs index 97b32189d00..a270b003981 100644 --- a/src/test/run-pass/init-res-into-things.rs +++ b/src/test/run-pass/init-res-into-things.rs @@ -8,10 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - -#![allow(unknown_features)] #![feature(box_syntax)] -#![feature(unsafe_destructor)] use std::cell::Cell; @@ -24,7 +21,6 @@ struct r<'a> { struct BoxR<'a> { x: r<'a> } -#[unsafe_destructor] impl<'a> Drop for r<'a> { fn drop(&mut self) { self.i.set(self.i.get() + 1) diff --git a/src/test/run-pass/issue-15858.rs b/src/test/run-pass/issue-15858.rs index 4f084d7891f..a1ada18984e 100644 --- a/src/test/run-pass/issue-15858.rs +++ b/src/test/run-pass/issue-15858.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - -#![feature(unsafe_destructor)] - static mut DROP_RAN: bool = false; trait Bar { @@ -26,7 +23,6 @@ impl Bar for BarImpl { struct Foo(B); -#[unsafe_destructor] impl Drop for Foo { fn drop(&mut self) { unsafe { diff --git a/src/test/run-pass/issue-15924.rs b/src/test/run-pass/issue-15924.rs index e544585745d..0c208773884 100644 --- a/src/test/run-pass/issue-15924.rs +++ b/src/test/run-pass/issue-15924.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -#![feature(unsafe_destructor, rustc_private)] +#![feature(rustc_private)] extern crate serialize; @@ -22,7 +22,6 @@ struct Foo { v: T, } -#[unsafe_destructor] impl Drop for Foo { fn drop(&mut self) { json::encode(&self.v); diff --git a/src/test/run-pass/issue-16492.rs b/src/test/run-pass/issue-16492.rs index fcb04627662..975557726ce 100644 --- a/src/test/run-pass/issue-16492.rs +++ b/src/test/run-pass/issue-16492.rs @@ -10,8 +10,6 @@ // ignore-pretty -#![feature(unsafe_destructor)] - use std::rc::Rc; use std::cell::Cell; @@ -29,7 +27,6 @@ impl Field { } } -#[unsafe_destructor] // because Field isn't Send impl Drop for Field { fn drop(&mut self) { println!("Dropping field {}", self.number); @@ -50,7 +47,6 @@ struct HasDropImpl { _three: Field } -#[unsafe_destructor] // because HasDropImpl isn't Send impl Drop for HasDropImpl { fn drop(&mut self) { println!("HasDropImpl.drop()"); diff --git a/src/test/run-pass/issue-17216.rs b/src/test/run-pass/issue-17216.rs index 6a8f7d992a2..e713bbf127d 100644 --- a/src/test/run-pass/issue-17216.rs +++ b/src/test/run-pass/issue-17216.rs @@ -8,14 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - -#![feature(unsafe_destructor)] - struct Leak<'a> { dropped: &'a mut bool } -#[unsafe_destructor] impl<'a> Drop for Leak<'a> { fn drop(&mut self) { *self.dropped = true; diff --git a/src/test/run-pass/issue-2718.rs b/src/test/run-pass/issue-2718.rs index 0df89c72424..a0f18d9f7f1 100644 --- a/src/test/run-pass/issue-2718.rs +++ b/src/test/run-pass/issue-2718.rs @@ -9,7 +9,7 @@ // except according to those terms. // -#![feature(unsafe_destructor, std_misc)] +#![feature(std_misc)] pub type Task = isize; @@ -165,8 +165,7 @@ pub mod pipes { p: Option<*const packet>, } - #[unsafe_destructor] - impl Drop for send_packet { + impl Drop for send_packet { fn drop(&mut self) { unsafe { if self.p != None { @@ -195,8 +194,7 @@ pub mod pipes { p: Option<*const packet>, } - #[unsafe_destructor] - impl Drop for recv_packet { + impl Drop for recv_packet { fn drop(&mut self) { unsafe { if self.p != None { diff --git a/src/test/run-pass/issue-2735-2.rs b/src/test/run-pass/issue-2735-2.rs index 36d7f4583b0..cdce059ae71 100644 --- a/src/test/run-pass/issue-2735-2.rs +++ b/src/test/run-pass/issue-2735-2.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - -#![feature(unsafe_destructor)] - use std::cell::Cell; // This test should behave exactly like issue-2735-3 @@ -18,7 +15,6 @@ struct defer<'a> { b: &'a Cell, } -#[unsafe_destructor] impl<'a> Drop for defer<'a> { fn drop(&mut self) { self.b.set(true); diff --git a/src/test/run-pass/issue-2735-3.rs b/src/test/run-pass/issue-2735-3.rs index f438519b72f..d1e28faba8b 100644 --- a/src/test/run-pass/issue-2735-3.rs +++ b/src/test/run-pass/issue-2735-3.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - -#![feature(unsafe_destructor)] - use std::cell::Cell; // This test should behave exactly like issue-2735-2 @@ -18,7 +15,6 @@ struct defer<'a> { b: &'a Cell, } -#[unsafe_destructor] impl<'a> Drop for defer<'a> { fn drop(&mut self) { self.b.set(true); diff --git a/src/test/run-pass/issue-4252.rs b/src/test/run-pass/issue-4252.rs index 73ef35f0457..e604141dab8 100644 --- a/src/test/run-pass/issue-4252.rs +++ b/src/test/run-pass/issue-4252.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unsafe_destructor)] - trait X { fn call(&self, x: &T); fn default_method(&self, x: &T) { @@ -31,7 +29,6 @@ impl X for Y { } } -#[unsafe_destructor] impl Drop for Z { fn drop(&mut self) { // These statements used to cause an ICE. diff --git a/src/test/run-pass/issue-979.rs b/src/test/run-pass/issue-979.rs index 979abcef7b8..43fa9812426 100644 --- a/src/test/run-pass/issue-979.rs +++ b/src/test/run-pass/issue-979.rs @@ -8,16 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - -#![feature(unsafe_destructor)] - use std::cell::Cell; struct r<'a> { b: &'a Cell, } -#[unsafe_destructor] impl<'a> Drop for r<'a> { fn drop(&mut self) { self.b.set(self.b.get() + 1); diff --git a/src/test/run-pass/newtype-struct-drop-run.rs b/src/test/run-pass/newtype-struct-drop-run.rs index 4407002aca8..6a5d86b522e 100644 --- a/src/test/run-pass/newtype-struct-drop-run.rs +++ b/src/test/run-pass/newtype-struct-drop-run.rs @@ -8,16 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - -#![feature(unsafe_destructor)] - // Make sure the destructor is run for newtype structs. use std::cell::Cell; struct Foo<'a>(&'a Cell); -#[unsafe_destructor] impl<'a> Drop for Foo<'a> { fn drop(&mut self) { let Foo(i) = *self; diff --git a/src/test/run-pass/option-unwrap.rs b/src/test/run-pass/option-unwrap.rs index 44f13a3eb1a..e22edb3caed 100644 --- a/src/test/run-pass/option-unwrap.rs +++ b/src/test/run-pass/option-unwrap.rs @@ -8,16 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - -#![feature(unsafe_destructor)] - use std::cell::Cell; struct dtor<'a> { x: &'a Cell, } -#[unsafe_destructor] impl<'a> Drop for dtor<'a> { fn drop(&mut self) { self.x.set(self.x.get() - 1); diff --git a/src/test/run-pass/regions-no-bound-in-argument-cleanup.rs b/src/test/run-pass/regions-no-bound-in-argument-cleanup.rs index 6cc32301cc4..cdb58d1ba4c 100644 --- a/src/test/run-pass/regions-no-bound-in-argument-cleanup.rs +++ b/src/test/run-pass/regions-no-bound-in-argument-cleanup.rs @@ -10,8 +10,6 @@ // pretty-expanded FIXME #23616 -#![feature(unsafe_destructor)] - use std::marker; pub struct Foo(marker::PhantomData); @@ -24,7 +22,6 @@ impl Iterator for Foo { } } -#[unsafe_destructor] impl Drop for Foo { fn drop(&mut self) { self.next(); diff --git a/src/test/run-pass/resource-assign-is-not-copy.rs b/src/test/run-pass/resource-assign-is-not-copy.rs index ba63c2db7cf..4d0c2900a0f 100644 --- a/src/test/run-pass/resource-assign-is-not-copy.rs +++ b/src/test/run-pass/resource-assign-is-not-copy.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unsafe_destructor)] - use std::cell::Cell; #[derive(Debug)] @@ -17,7 +15,6 @@ struct r<'a> { i: &'a Cell, } -#[unsafe_destructor] impl<'a> Drop for r<'a> { fn drop(&mut self) { self.i.set(self.i.get() + 1); diff --git a/src/test/run-pass/resource-destruct.rs b/src/test/run-pass/resource-destruct.rs index 229ceba08b0..5b2b8655442 100644 --- a/src/test/run-pass/resource-destruct.rs +++ b/src/test/run-pass/resource-destruct.rs @@ -8,15 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(unsafe_destructor)] - use std::cell::Cell; struct shrinky_pointer<'a> { i: &'a Cell, } -#[unsafe_destructor] impl<'a> Drop for shrinky_pointer<'a> { fn drop(&mut self) { println!("Hello!"); self.i.set(self.i.get() - 1); diff --git a/src/test/run-pass/resource-in-struct.rs b/src/test/run-pass/resource-in-struct.rs index c1e1ff0658b..2914127246a 100644 --- a/src/test/run-pass/resource-in-struct.rs +++ b/src/test/run-pass/resource-in-struct.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - -#![feature(unsafe_destructor)] - // Ensures that class dtors run if the object is inside an enum // variant @@ -23,7 +20,6 @@ struct close_res<'a> { } -#[unsafe_destructor] impl<'a> Drop for close_res<'a> { fn drop(&mut self) { self.i.set(false); diff --git a/src/test/run-pass/unboxed-closures-infer-fnonce-move.rs b/src/test/run-pass/unboxed-closures-infer-fnonce-move.rs index dcda724c7b8..449f533103a 100644 --- a/src/test/run-pass/unboxed-closures-infer-fnonce-move.rs +++ b/src/test/run-pass/unboxed-closures-infer-fnonce-move.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - -#![feature(unsafe_destructor)] - // Test that we are able to infer a suitable kind for this `move` // closure that is just called (`FnOnce`). @@ -18,7 +15,6 @@ use std::mem; struct DropMe<'a>(&'a mut i32); -#[unsafe_destructor] impl<'a> Drop for DropMe<'a> { fn drop(&mut self) { *self.0 += 1; diff --git a/src/test/run-pass/unboxed-closures-infer-fnonce.rs b/src/test/run-pass/unboxed-closures-infer-fnonce.rs index 275ba0520c5..79a1aff8535 100644 --- a/src/test/run-pass/unboxed-closures-infer-fnonce.rs +++ b/src/test/run-pass/unboxed-closures-infer-fnonce.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - -#![feature(unsafe_destructor)] - // Test that we are able to infer a suitable kind for this closure // that is just called (`FnOnce`). @@ -18,7 +15,6 @@ use std::mem; struct DropMe<'a>(&'a mut i32); -#[unsafe_destructor] impl<'a> Drop for DropMe<'a> { fn drop(&mut self) { *self.0 += 1; diff --git a/src/test/run-pass/vec-slice-drop.rs b/src/test/run-pass/vec-slice-drop.rs index f400869682f..86d34d38f74 100644 --- a/src/test/run-pass/vec-slice-drop.rs +++ b/src/test/run-pass/vec-slice-drop.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - -#![feature(unsafe_destructor)] - use std::cell::Cell; // Make sure that destructors get run on slice literals @@ -18,7 +15,6 @@ struct foo<'a> { x: &'a Cell, } -#[unsafe_destructor] impl<'a> Drop for foo<'a> { fn drop(&mut self) { self.x.set(self.x.get() + 1);