Register new snapshots

This commit is contained in:
Tamir Duberstein 2015-04-27 14:10:49 -07:00
parent 8871c17b76
commit 69abc12b00
89 changed files with 29 additions and 397 deletions

View File

@ -355,7 +355,6 @@ impl<T: Clone> Arc<T> {
}
}
#[unsafe_destructor]
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> Drop for Arc<T> {
/// Drops the `Arc<T>`.
@ -489,7 +488,6 @@ impl<T> Clone for Weak<T> {
}
}
#[unsafe_destructor]
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> Drop for Weak<T> {
/// Drops the `Weak<T>`.

View File

@ -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)]

View File

@ -375,7 +375,6 @@ impl<T> Deref for Rc<T> {
}
}
#[unsafe_destructor]
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> Drop for Rc<T> {
/// Drops the `Rc<T>`.
@ -693,7 +692,6 @@ impl<T> Weak<T> {
}
}
#[unsafe_destructor]
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> Drop for Weak<T> {
/// Drops the `Weak<T>`.

View File

@ -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<T> TypedArena<T> {
}
}
#[unsafe_destructor]
impl<T> Drop for TypedArena<T> {
fn drop(&mut self) {
unsafe {

View File

@ -270,14 +270,12 @@ impl<T> DoubleEndedIterator for RawItems<T> {
}
}
#[unsafe_destructor]
impl<T> Drop for RawItems<T> {
fn drop(&mut self) {
for _ in self.by_ref() {}
}
}
#[unsafe_destructor]
impl<K, V> Drop for Node<K, V> {
fn drop(&mut self) {
if self.keys.is_null() ||
@ -1394,7 +1392,6 @@ impl<K, V> TraversalImpl for MoveTraversalImpl<K, V> {
}
}
#[unsafe_destructor]
impl<K, V> Drop for MoveTraversalImpl<K, V> {
fn drop(&mut self) {
// We need to cleanup the stored values manually, as the RawItems destructor would run

View File

@ -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)]

View File

@ -624,7 +624,6 @@ impl<T> LinkedList<T> {
}
}
#[unsafe_destructor]
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> Drop for LinkedList<T> {
fn drop(&mut self) {

View File

@ -1626,7 +1626,6 @@ impl<'a, T: Clone> Add<&'a [T]> for Vec<T> {
}
}
#[unsafe_destructor]
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> Drop for Vec<T> {
fn drop(&mut self) {
@ -1808,7 +1807,6 @@ impl<T> DoubleEndedIterator for IntoIter<T> {
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> ExactSizeIterator for IntoIter<T> {}
#[unsafe_destructor]
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> Drop for IntoIter<T> {
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<T>` 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<T,U> {
marker: PhantomData<::core::cell::Cell<(T,U)>>,
}
#[unsafe_destructor]
impl<T,U> Drop for PartialVecNonZeroSized<T,U> {
fn drop(&mut self) {
unsafe {
@ -2009,7 +2004,6 @@ impl<T,U> Drop for PartialVecNonZeroSized<T,U> {
}
}
#[unsafe_destructor]
impl<T,U> Drop for PartialVecZeroSized<T,U> {
fn drop(&mut self) {
unsafe {

View File

@ -59,7 +59,6 @@ impl<T: Clone> Clone for VecDeque<T> {
}
}
#[unsafe_destructor]
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> Drop for VecDeque<T> {
fn drop(&mut self) {
@ -1612,7 +1611,6 @@ pub struct Drain<'a, T: 'a> {
inner: &'a mut VecDeque<T>,
}
#[unsafe_destructor]
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: 'a> Drop for Drain<'a, T> {
fn drop(&mut self) {

View File

@ -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))]

View File

@ -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;

View File

@ -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<BorrowFlag>,
}
#[unsafe_destructor]
impl<'b> Drop for BorrowRefMut<'b> {
#[inline]
fn drop(&mut self) {

View File

@ -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> {

View File

@ -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)
}

View File

@ -303,14 +303,8 @@ extern "rust-intrinsic" {
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg(not(stage0))]
pub fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize);
/// dox
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg(stage0)]
pub fn copy_nonoverlapping<T>(dst: *mut T, src: *const T, count: usize);
/// Copies `count * size_of<T>` 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<T>(src: *const T, dst: *mut T, count: usize);
/// dox
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg(stage0)]
pub fn copy<T>(dst: *mut T, src: *const T, count: usize);
/// Invokes memset on the specified pointer, setting `count * size_of::<T>()`
/// 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<T>(v: &T) -> u64;
}

View File

@ -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)]

View File

@ -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<T> !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<T> !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<Self,Self> { }
#[cfg(stage0)]
impl<T: ?Sized> MarkerTrait for T {}
/// dox
#[lang="phantom_fn"]
#[cfg(stage0)]
pub trait PhantomFn<A:?Sized,R:?Sized=()> {
}
/// `PhantomData<T>` 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 .. { }

View File

@ -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<T:?Sized> Zeroable for *const T {}
unsafe impl<T:?Sized> Zeroable for *mut T {}
unsafe impl Zeroable for isize {}

View File

@ -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<Args> {
extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
}
#[cfg(not(stage0))]
mod impls {
use marker::Sized;
use super::{Fn, FnMut, FnOnce};

View File

@ -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<T>(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<T>(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;

View File

@ -13,7 +13,6 @@
#![feature(box_syntax)]
#![feature(unboxed_closures)]
#![feature(unsafe_destructor)]
#![feature(core)]
#![feature(test)]
#![feature(rand)]

View File

@ -44,8 +44,7 @@ fn test_get_resource() {
i: Rc<RefCell<isize>>,
}
#[unsafe_destructor]
impl Drop for R {
impl Drop for R {
fn drop(&mut self) {
let ii = &*self.i;
let i = *ii.borrow();

View File

@ -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)]

View File

@ -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;

View File

@ -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)]

View File

@ -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))]

View File

@ -105,7 +105,6 @@ impl<'a> Iterator for Iter<'a> {
}
}
#[unsafe_destructor]
impl<'a> Drop for Iter<'a> {
fn drop(&mut self) {
unsafe {

View File

@ -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;

View File

@ -34,7 +34,6 @@
#![feature(quote)]
#![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)]
#![feature(unsafe_destructor)]
#![feature(staged_api)]
#![feature(unicode)]
#![feature(path_ext)]

View File

@ -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() {

View File

@ -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;

View File

@ -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<K: Clone, V: Clone> Clone for RawTable<K, V> {
}
}
#[unsafe_destructor]
impl<K, V> Drop for RawTable<K, V> {
fn drop(&mut self) {
if self.capacity == 0 || self.capacity == mem::POST_DROP_USIZE {

View File

@ -292,7 +292,6 @@ impl<W: Write+Seek> Seek for BufWriter<W> {
}
}
#[unsafe_destructor]
impl<W: Write> Drop for BufWriter<W> {
fn drop(&mut self) {
if self.inner.is_some() {

View File

@ -70,8 +70,7 @@ fn append_to_string<F>(buf: &mut String, f: F) -> Result<usize>
where F: FnOnce(&mut Vec<u8>) -> Result<usize>
{
struct Guard<'a> { s: &'a mut Vec<u8>, 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); }
}

View File

@ -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)]

View File

@ -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")

View File

@ -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<M: Any + Send>(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<M: Any + Send>(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,

View File

@ -619,7 +619,6 @@ impl<T> Clone for Sender<T> {
}
}
#[unsafe_destructor]
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> Drop for Sender<T> {
fn drop(&mut self) {
@ -683,7 +682,6 @@ impl<T> Clone for SyncSender<T> {
}
}
#[unsafe_destructor]
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> Drop for SyncSender<T> {
fn drop(&mut self) {
@ -930,7 +928,6 @@ impl <T> IntoIterator for Receiver<T> {
}
}
#[unsafe_destructor]
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> Drop for Receiver<T> {
fn drop(&mut self) {

View File

@ -138,7 +138,6 @@ impl<T> Queue<T> {
}
}
#[unsafe_destructor]
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> Drop for Queue<T> {
fn drop(&mut self) {

View File

@ -367,7 +367,6 @@ impl<T> Packet<T> {
}
}
#[unsafe_destructor]
impl<T> Drop for Packet<T> {
fn drop(&mut self) {
assert_eq!(self.state.load(Ordering::SeqCst), DISCONNECTED);

View File

@ -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() }

View File

@ -473,7 +473,6 @@ impl<T> Packet<T> {
}
}
#[unsafe_destructor]
impl<T> Drop for Packet<T> {
fn drop(&mut self) {
// Note that this load is not only an assert for correctness about

View File

@ -226,7 +226,6 @@ impl<T> Queue<T> {
}
}
#[unsafe_destructor]
impl<T> Drop for Queue<T> {
fn drop(&mut self) {
unsafe {

View File

@ -471,7 +471,6 @@ impl<T> Packet<T> {
}
}
#[unsafe_destructor]
impl<T> Drop for Packet<T> {
fn drop(&mut self) {
// Note that this load is not only an assert for correctness about

View File

@ -411,7 +411,6 @@ impl<T> Packet<T> {
}
}
#[unsafe_destructor]
impl<T> Drop for Packet<T> {
fn drop(&mut self) {
assert_eq!(self.channels.load(Ordering::SeqCst), 0);

View File

@ -244,7 +244,6 @@ impl<T> Mutex<T> {
}
}
#[unsafe_destructor]
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> Drop for Mutex<T> {
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]

View File

@ -249,7 +249,6 @@ impl<T> RwLock<T> {
}
}
#[unsafe_destructor]
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> Drop for RwLock<T> {
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) {

View File

@ -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) {

View File

@ -96,7 +96,6 @@ impl<T> ReentrantMutex<T> {
}
}
#[unsafe_destructor]
impl<T> Drop for ReentrantMutex<T> {
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) {

View File

@ -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> {

View File

@ -171,8 +171,7 @@ impl<T> ScopedKey<T> {
key: &'a __impl::KeyInner<T>,
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) }
}

View File

@ -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",

View File

@ -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

View File

@ -11,8 +11,6 @@
#![crate_name="issue_2526"]
#![crate_type = "lib"]
#![feature(unsafe_destructor)]
use std::marker;
struct arc_destruct<T: Sync> {
@ -20,7 +18,6 @@ struct arc_destruct<T: Sync> {
_marker: marker::PhantomData<T>
}
#[unsafe_destructor]
impl<T: Sync> Drop for arc_destruct<T> {
fn drop(&mut self) {}
}

View File

@ -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<nillist>,
}
#[unsafe_destructor]
impl Drop for r {
fn drop(&mut self) {}
}

View File

@ -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 {

View File

@ -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<T:HasId> {
#[allow(non_snake_case)]
fn CheckId<T:HasId>(t: T) -> CheckId<T> { CheckId{ v: t } }
#[unsafe_destructor]
impl<T:HasId> Drop for CheckId<T> {
fn drop(&mut self) {
assert!(self.v.count() > 0);

View File

@ -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 {:?}",

View File

@ -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<T:HasId> {
#[allow(non_snake_case)]
fn CheckId<T:HasId>(t: T) -> CheckId<T> { CheckId{ v: t } }
#[unsafe_destructor]
impl<T:HasId> Drop for CheckId<T> {
fn drop(&mut self) {
assert!(self.v.count() > 0);

View File

@ -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<T:HasId> { v: T }
// interface to CheckId does not (and cannot) know that, and therefore
// when encountering the a value V of type CheckId<S>, we must
// conservatively force the type S to strictly outlive V.
#[unsafe_destructor]
impl<T:HasId> Drop for CheckId<T> {
fn drop(&mut self) {
assert!(self.v.count() > 0);

View File

@ -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<T:HasId> {
#[allow(non_snake_case)]
fn CheckId<T:HasId>(t: T) -> CheckId<T> { CheckId{ v: t } }
#[unsafe_destructor]
impl<T:HasId> Drop for CheckId<T> {
fn drop(&mut self) {
assert!(self.v.count() > 0);

View File

@ -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<T>(::std::marker::PhantomData<T>);
#[unsafe_destructor]
impl<T> Drop for Bar<T> {
fn drop(&mut self) {}
}

View File

@ -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 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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() { }

View File

@ -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) {}
}

View File

@ -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<Tva, Tvb> { 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<Cok_nobound> Drop for O<Cok_nobound> { fn drop(&mut self) { } } // ACCEPT
#[unsafe_destructor]
impl Drop for P<i8> { fn drop(&mut self) { } } // REJECT
//~^ ERROR Implementations of Drop cannot be specialized
#[unsafe_destructor]
impl<Adds_bnd:Bound> Drop for Q<Adds_bnd> { 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<Adds_rbnd> { fn drop(&mut self) { } } // REJECT
//~^ ERROR The requirement `Adds_rbnd : 'rbnd` is added only by the Drop impl.
#[unsafe_destructor]
impl<Bs:Bound> Drop for S<Bs> { 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<One> Drop for V<One,One> { 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

View File

@ -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<isize>,
}
#[unsafe_destructor]
impl<'a> Drop for r<'a> {
fn drop(&mut self) {
unsafe {

View File

@ -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<T:HasId> {
#[allow(non_snake_case)]
fn CheckId<T:HasId>(t: T) -> CheckId<T> { CheckId{ v: t } }
#[unsafe_destructor]
impl<T:HasId> Drop for CheckId<T> {
fn drop(&mut self) {
assert!(self.v.count() > 0);

View File

@ -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<T> {
a: T
}
#[unsafe_destructor]
impl<T> Drop for Test<T> {
fn drop(&mut self) { }
}

View File

@ -8,13 +8,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
struct S<T> {
x: T
}
#[unsafe_destructor]
impl<T> ::std::ops::Drop for S<T> {
fn drop(&mut self) {
println!("bye");

View File

@ -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<T:HasId> { v: T }
// interface to CheckId does not (and cannot) know that, and therefore
// when encountering the a value V of type CheckId<S>, we must
// conservatively force the type S to strictly outlive V.
#[unsafe_destructor]
impl<T:HasId> Drop for CheckId<T> {
fn drop(&mut self) {
assert!(self.v.count() > 0);

View File

@ -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)

View File

@ -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: Bar>(B);
#[unsafe_destructor]
impl<B: Bar> Drop for Foo<B> {
fn drop(&mut self) {
unsafe {

View File

@ -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<T: Encodable> {
v: T,
}
#[unsafe_destructor]
impl<T: Encodable> Drop for Foo<T> {
fn drop(&mut self) {
json::encode(&self.v);

View File

@ -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()");

View File

@ -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;

View File

@ -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<T>>,
}
#[unsafe_destructor]
impl<T:Send> Drop for send_packet<T> {
impl<T:Send> Drop for send_packet<T> {
fn drop(&mut self) {
unsafe {
if self.p != None {
@ -195,8 +194,7 @@ pub mod pipes {
p: Option<*const packet<T>>,
}
#[unsafe_destructor]
impl<T:Send> Drop for recv_packet<T> {
impl<T:Send> Drop for recv_packet<T> {
fn drop(&mut self) {
unsafe {
if self.p != None {

View File

@ -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<bool>,
}
#[unsafe_destructor]
impl<'a> Drop for defer<'a> {
fn drop(&mut self) {
self.b.set(true);

View File

@ -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<bool>,
}
#[unsafe_destructor]
impl<'a> Drop for defer<'a> {
fn drop(&mut self) {
self.b.set(true);

View File

@ -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<T: std::fmt::Debug>(&self, x: &T);
fn default_method<T: std::fmt::Debug>(&self, x: &T) {
@ -31,7 +29,6 @@ impl X for Y {
}
}
#[unsafe_destructor]
impl<T: X + std::fmt::Debug> Drop for Z<T> {
fn drop(&mut self) {
// These statements used to cause an ICE.

View File

@ -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<isize>,
}
#[unsafe_destructor]
impl<'a> Drop for r<'a> {
fn drop(&mut self) {
self.b.set(self.b.get() + 1);

View File

@ -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<isize>);
#[unsafe_destructor]
impl<'a> Drop for Foo<'a> {
fn drop(&mut self) {
let Foo(i) = *self;

View File

@ -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<isize>,
}
#[unsafe_destructor]
impl<'a> Drop for dtor<'a> {
fn drop(&mut self) {
self.x.set(self.x.get() - 1);

View File

@ -10,8 +10,6 @@
// pretty-expanded FIXME #23616
#![feature(unsafe_destructor)]
use std::marker;
pub struct Foo<T>(marker::PhantomData<T>);
@ -24,7 +22,6 @@ impl<T> Iterator for Foo<T> {
}
}
#[unsafe_destructor]
impl<T> Drop for Foo<T> {
fn drop(&mut self) {
self.next();

View File

@ -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<isize>,
}
#[unsafe_destructor]
impl<'a> Drop for r<'a> {
fn drop(&mut self) {
self.i.set(self.i.get() + 1);

View File

@ -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<isize>,
}
#[unsafe_destructor]
impl<'a> Drop for shrinky_pointer<'a> {
fn drop(&mut self) {
println!("Hello!"); self.i.set(self.i.get() - 1);

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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<isize>,
}
#[unsafe_destructor]
impl<'a> Drop for foo<'a> {
fn drop(&mut self) {
self.x.set(self.x.get() + 1);