Stabilization of impls and fallout from stabilization

This commit is contained in:
Aaron Turon
2015-01-04 16:16:55 -08:00
parent cb765ce7e1
commit c6f4a03d12
29 changed files with 128 additions and 49 deletions

View File

@@ -188,6 +188,7 @@ impl Condvar {
pub fn notify_all(&self) { unsafe { self.inner.inner.notify_all() } }
}
#[stable]
impl Drop for Condvar {
fn drop(&mut self) {
unsafe { self.inner.inner.destroy() }

View File

@@ -657,6 +657,7 @@ impl<T: Send> Clone for Sender<T> {
}
#[unsafe_destructor]
#[stable]
impl<T: Send> Drop for Sender<T> {
fn drop(&mut self) {
match *unsafe { self.inner_mut() } {
@@ -720,6 +721,7 @@ impl<T: Send> Clone for SyncSender<T> {
}
#[unsafe_destructor]
#[stable]
impl<T: Send> Drop for SyncSender<T> {
fn drop(&mut self) {
unsafe { (*self.inner.get()).drop_chan(); }
@@ -935,7 +937,7 @@ impl<T: Send> select::Packet for Receiver<T> {
}
}
#[unstable]
#[stable]
impl<'a, T: Send> Iterator for Iter<'a, T> {
type Item = T;
@@ -943,6 +945,7 @@ impl<'a, T: Send> Iterator for Iter<'a, T> {
}
#[unsafe_destructor]
#[stable]
impl<T: Send> Drop for Receiver<T> {
fn drop(&mut self) {
match *unsafe { self.inner_mut() } {

View File

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

View File

@@ -228,6 +228,7 @@ impl<T: Send> Mutex<T> {
}
#[unsafe_destructor]
#[stable]
impl<T: Send> Drop for Mutex<T> {
fn drop(&mut self) {
// This is actually safe b/c we know that there is no further usage of
@@ -291,6 +292,7 @@ impl<'mutex, T> MutexGuard<'mutex, T> {
}
}
#[stable]
impl<'mutex, T> Deref for MutexGuard<'mutex, T> {
type Target = T;
@@ -298,6 +300,7 @@ impl<'mutex, T> Deref for MutexGuard<'mutex, T> {
unsafe { &*self.__data.get() }
}
}
#[stable]
impl<'mutex, T> DerefMut for MutexGuard<'mutex, T> {
fn deref_mut<'a>(&'a mut self) -> &'a mut T {
unsafe { &mut *self.__data.get() }
@@ -305,6 +308,7 @@ impl<'mutex, T> DerefMut for MutexGuard<'mutex, T> {
}
#[unsafe_destructor]
#[stable]
impl<'a, T> Drop for MutexGuard<'a, T> {
#[inline]
fn drop(&mut self) {

View File

@@ -228,6 +228,7 @@ impl<T: Send + Sync> RWLock<T> {
}
#[unsafe_destructor]
#[stable]
impl<T> Drop for RWLock<T> {
fn drop(&mut self) {
unsafe { self.inner.lock.destroy() }
@@ -327,16 +328,19 @@ impl<'rwlock, T> RWLockWriteGuard<'rwlock, T> {
}
}
#[stable]
impl<'rwlock, T> Deref for RWLockReadGuard<'rwlock, T> {
type Target = T;
fn deref(&self) -> &T { unsafe { &*self.__data.get() } }
}
#[stable]
impl<'rwlock, T> Deref for RWLockWriteGuard<'rwlock, T> {
type Target = T;
fn deref(&self) -> &T { unsafe { &*self.__data.get() } }
}
#[stable]
impl<'rwlock, T> DerefMut for RWLockWriteGuard<'rwlock, T> {
fn deref_mut(&mut self) -> &mut T {
unsafe { &mut *self.__data.get() }
@@ -344,6 +348,7 @@ impl<'rwlock, T> DerefMut for RWLockWriteGuard<'rwlock, T> {
}
#[unsafe_destructor]
#[stable]
impl<'a, T> Drop for RWLockReadGuard<'a, T> {
fn drop(&mut self) {
unsafe { self.__lock.lock.read_unlock(); }
@@ -351,6 +356,7 @@ impl<'a, T> Drop for RWLockReadGuard<'a, T> {
}
#[unsafe_destructor]
#[stable]
impl<'a, T> Drop for RWLockWriteGuard<'a, T> {
fn drop(&mut self) {
self.__lock.poison.done(&self.__poison);

View File

@@ -99,6 +99,7 @@ impl Semaphore {
}
#[unsafe_destructor]
#[stable]
impl<'a> Drop for SemaphoreGuard<'a> {
fn drop(&mut self) {
self.sem.release();