diff options
Diffstat (limited to 'compiler/rustc_data_structures/src/sync.rs')
| -rw-r--r-- | compiler/rustc_data_structures/src/sync.rs | 20 | 
1 files changed, 0 insertions, 20 deletions
| diff --git a/compiler/rustc_data_structures/src/sync.rs b/compiler/rustc_data_structures/src/sync.rs index bea87a6685d..779127ce32f 100644 --- a/compiler/rustc_data_structures/src/sync.rs +++ b/compiler/rustc_data_structures/src/sync.rs @@ -204,12 +204,6 @@ impl<T> RwLock<T> { } #[inline(always)] - #[track_caller] - pub fn with_read_lock<F: FnOnce(&T) -> R, R>(&self, f: F) -> R { - f(&*self.read()) - } - - #[inline(always)] pub fn try_write(&self) -> Result<WriteGuard<'_, T>, ()> { self.0.try_write().ok_or(()) } @@ -225,12 +219,6 @@ impl<T> RwLock<T> { #[inline(always)] #[track_caller] - pub fn with_write_lock<F: FnOnce(&mut T) -> R, R>(&self, f: F) -> R { - f(&mut *self.write()) - } - - #[inline(always)] - #[track_caller] pub fn borrow(&self) -> ReadGuard<'_, T> { self.read() } @@ -240,14 +228,6 @@ impl<T> RwLock<T> { pub fn borrow_mut(&self) -> WriteGuard<'_, T> { self.write() } - - #[inline(always)] - pub fn leak(&self) -> &T { - let guard = self.read(); - let ret = unsafe { &*(&raw const *guard) }; - std::mem::forget(guard); - ret - } } // FIXME: Probably a bad idea | 
