about summary refs log tree commit diff
path: root/src/libstd/sys_common
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2018-05-07 09:27:50 -0700
committerManish Goregaokar <manishsmail@gmail.com>2018-05-07 10:26:28 -0700
commitf8b774fbf1f57e520b58ae3828e4b3a1ddf1d97c (patch)
tree6ff66cfcfe7d724a5f2fd7248e4e818123a19f9f /src/libstd/sys_common
parent6e49c837f614a8670a5773428b4934eb280bca61 (diff)
downloadrust-f8b774fbf1f57e520b58ae3828e4b3a1ddf1d97c.tar.gz
rust-f8b774fbf1f57e520b58ae3828e4b3a1ddf1d97c.zip
Add explanation for #[must_use] on mutex guards
Diffstat (limited to 'src/libstd/sys_common')
-rw-r--r--src/libstd/sys_common/remutex.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/sys_common/remutex.rs b/src/libstd/sys_common/remutex.rs
index ce43ec6d9ab..022056f8a8a 100644
--- a/src/libstd/sys_common/remutex.rs
+++ b/src/libstd/sys_common/remutex.rs
@@ -41,7 +41,7 @@ unsafe impl<T: Send> Sync for ReentrantMutex<T> {}
 /// because implementation of the trait would violate Rust’s reference aliasing
 /// rules. Use interior mutability (usually `RefCell`) in order to mutate the
 /// guarded data.
-#[must_use]
+#[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).