From 55f58b5cb8daf705c012799205d5d258d438ca7c Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Thu, 11 Jun 2020 10:52:24 +0100 Subject: [PATCH] Remove deprecated and unsound MappedRwLockWriteGuard::downgrade --- lock_api/src/rwlock.rs | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/lock_api/src/rwlock.rs b/lock_api/src/rwlock.rs index 4cdfd6be..668688c1 100644 --- a/lock_api/src/rwlock.rs +++ b/lock_api/src/rwlock.rs @@ -1559,30 +1559,6 @@ impl<'a, R: RawRwLock + 'a, T: ?Sized + 'a> MappedRwLockWriteGuard<'a, R, T> { } } -impl<'a, R: RawRwLockDowngrade + 'a, T: ?Sized + 'a> MappedRwLockWriteGuard<'a, R, T> { - /// Atomically downgrades a write lock into a read lock without allowing any - /// writers to take exclusive access of the lock in the meantime. - /// - /// Note that if there are any writers currently waiting to take the lock - /// then other readers may not be able to acquire the lock even if it was - /// downgraded. - #[deprecated( - since = "0.3.3", - note = "This function is unsound and will be removed in the future, see issue #198" - )] - pub fn downgrade(s: Self) -> MappedRwLockReadGuard<'a, R, T> { - s.raw.downgrade(); - let raw = s.raw; - let data = s.data; - mem::forget(s); - MappedRwLockReadGuard { - raw, - data, - marker: PhantomData, - } - } -} - impl<'a, R: RawRwLockFair + 'a, T: ?Sized + 'a> MappedRwLockWriteGuard<'a, R, T> { /// Unlocks the `RwLock` using a fair unlock protocol. ///