diff options
| author | Askar Safin <safinaskar@mail.ru> | 2025-02-08 11:55:41 +0300 | 
|---|---|---|
| committer | Askar Safin <safinaskar@mail.ru> | 2025-02-11 07:55:57 +0300 | 
| commit | 42ceb2567979cacb97b58c779a76207b24620fa0 (patch) | |
| tree | d92a2c0aef7eac61efb58879fd325467197d02f7 /compiler | |
| parent | 6171d944aea415a3023d4262e0895aa3b18c771f (diff) | |
| download | rust-42ceb2567979cacb97b58c779a76207b24620fa0.tar.gz rust-42ceb2567979cacb97b58c779a76207b24620fa0.zip | |
compiler/rustc_data_structures/src/sync.rs: these RwLock methods are never called, so let's remove them
Diffstat (limited to 'compiler')
| -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 | 
