about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@gmail.com>2015-04-27 14:10:49 -0700
committerTamir Duberstein <tamird@gmail.com>2015-04-28 17:23:45 -0700
commit69abc12b0044d641e714bdd73a299cfa4136b7b8 (patch)
treeb434c9c4a9b8260632c8a6c20823c95a8f5a02e7 /src/libstd
parent8871c17b76a1e0ab36ce2bb51008b53f596e5b3c (diff)
downloadrust-69abc12b0044d641e714bdd73a299cfa4136b7b8.tar.gz
rust-69abc12b0044d641e714bdd73a299cfa4136b7b8.zip
Register new snapshots
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/collections/hash/table.rs2
-rw-r--r--src/libstd/io/buffered.rs1
-rw-r--r--src/libstd/io/mod.rs3
-rw-r--r--src/libstd/lib.rs1
-rw-r--r--src/libstd/macros.rs25
-rw-r--r--src/libstd/rt/unwind.rs17
-rw-r--r--src/libstd/sync/mpsc/mod.rs3
-rw-r--r--src/libstd/sync/mpsc/mpsc_queue.rs1
-rw-r--r--src/libstd/sync/mpsc/oneshot.rs1
-rw-r--r--src/libstd/sync/mpsc/select.rs2
-rw-r--r--src/libstd/sync/mpsc/shared.rs1
-rw-r--r--src/libstd/sync/mpsc/spsc_queue.rs1
-rw-r--r--src/libstd/sync/mpsc/stream.rs1
-rw-r--r--src/libstd/sync/mpsc/sync.rs1
-rw-r--r--src/libstd/sync/mutex.rs2
-rw-r--r--src/libstd/sync/rwlock.rs3
-rw-r--r--src/libstd/sync/semaphore.rs1
-rw-r--r--src/libstd/sys/common/remutex.rs2
-rw-r--r--src/libstd/thread/mod.rs1
-rw-r--r--src/libstd/thread/scoped_tls.rs3
20 files changed, 2 insertions, 70 deletions
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<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 {
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<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() {
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<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); }
         }
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<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,
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<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) {
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<T> Queue<T> {
     }
 }
 
-#[unsafe_destructor]
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> Drop for Queue<T> {
     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<T> Packet<T> {
     }
 }
 
-#[unsafe_destructor]
 impl<T> Drop for Packet<T> {
     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<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
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<T> Queue<T> {
     }
 }
 
-#[unsafe_destructor]
 impl<T> Drop for Queue<T> {
     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<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
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<T> Packet<T> {
     }
 }
 
-#[unsafe_destructor]
 impl<T> Drop for Packet<T> {
     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<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]
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<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) {
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<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) {
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<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) }
             }