diff --git a/compiler/rustc_data_structures/src/sync.rs b/compiler/rustc_data_structures/src/sync.rs index bea87a6685d8..779127ce32f7 100644 --- a/compiler/rustc_data_structures/src/sync.rs +++ b/compiler/rustc_data_structures/src/sync.rs @@ -203,12 +203,6 @@ pub fn read(&self) -> ReadGuard<'_, T> { } } - #[inline(always)] - #[track_caller] - pub fn with_read_lock R, R>(&self, f: F) -> R { - f(&*self.read()) - } - #[inline(always)] pub fn try_write(&self) -> Result, ()> { self.0.try_write().ok_or(()) @@ -223,12 +217,6 @@ pub fn write(&self) -> WriteGuard<'_, T> { } } - #[inline(always)] - #[track_caller] - pub fn with_write_lock R, R>(&self, f: F) -> R { - f(&mut *self.write()) - } - #[inline(always)] #[track_caller] pub fn borrow(&self) -> ReadGuard<'_, T> { @@ -240,14 +228,6 @@ pub fn borrow(&self) -> ReadGuard<'_, 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