about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorJonas Schievink <jonasschievink@gmail.com>2020-09-25 02:29:51 +0200
committerGitHub <noreply@github.com>2020-09-25 02:29:51 +0200
commitfc4dc5f162115076dae2b87c3fdcc1c9fe79154b (patch)
tree4bdc96f0581223bc393dca89f8e5fa9000fdd6fa /library/std/src
parentb8d158b0f8b2a3f3e47ab104ae8566e76e41d3c5 (diff)
parent13dc237037c8ef66423639c622d6018f1cf9a37e (diff)
downloadrust-fc4dc5f162115076dae2b87c3fdcc1c9fe79154b.tar.gz
rust-fc4dc5f162115076dae2b87c3fdcc1c9fe79154b.zip
Rollup merge of #77164 - fusion-engineering-forks:no-more-funny-underscores, r=Mark-Simulacrum
Remove workaround for deref issue that no longer exists.

The double underscores were used to work around issue #12808, which was solved in 2016.
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/sys_common/remutex.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/library/std/src/sys_common/remutex.rs b/library/std/src/sys_common/remutex.rs
index 360337c030b..162eab2388d 100644
--- a/library/std/src/sys_common/remutex.rs
+++ b/library/std/src/sys_common/remutex.rs
@@ -37,9 +37,7 @@ impl<T> RefUnwindSafe for ReentrantMutex<T> {}
 /// guarded data.
 #[must_use = "if unused the ReentrantMutex will immediately unlock"]
 pub struct ReentrantMutexGuard<'a, T: 'a> {
-    // funny underscores due to how Deref currently works (it disregards field
-    // privacy).
-    __lock: &'a ReentrantMutex<T>,
+    lock: &'a ReentrantMutex<T>,
 }
 
 impl<T> !marker::Send for ReentrantMutexGuard<'_, T> {}
@@ -129,7 +127,7 @@ impl<T: fmt::Debug + 'static> fmt::Debug for ReentrantMutex<T> {
 
 impl<'mutex, T> ReentrantMutexGuard<'mutex, T> {
     fn new(lock: &'mutex ReentrantMutex<T>) -> ReentrantMutexGuard<'mutex, T> {
-        ReentrantMutexGuard { __lock: lock }
+        ReentrantMutexGuard { lock }
     }
 }
 
@@ -137,7 +135,7 @@ impl<T> Deref for ReentrantMutexGuard<'_, T> {
     type Target = T;
 
     fn deref(&self) -> &T {
-        &self.__lock.data
+        &self.lock.data
     }
 }
 
@@ -145,7 +143,7 @@ impl<T> Drop for ReentrantMutexGuard<'_, T> {
     #[inline]
     fn drop(&mut self) {
         unsafe {
-            self.__lock.inner.unlock();
+            self.lock.inner.unlock();
         }
     }
 }