about summary refs log tree commit diff
path: root/src/libstd/sys_common
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-05-09 17:26:38 +0800
committerkennytm <kennytm@gmail.com>2018-05-09 20:29:46 +0800
commit4924fea2026c0360cd57106ee6f1199924ad50e1 (patch)
tree1a6ea1fe9ae65414a279c97bbd289c141e59ffed /src/libstd/sys_common
parent4c3ab33f3a94b7ce21a28658d403e27a81ef042d (diff)
parenta72a0801bdab22d7c0167f67d1148276ea874d2e (diff)
downloadrust-4924fea2026c0360cd57106ee6f1199924ad50e1.tar.gz
rust-4924fea2026c0360cd57106ee6f1199924ad50e1.zip
Rollup merge of #50511 - Manishearth:must-use, r=QuietMisdreavus
Add some explanations for #[must_use]

`#[must_use]` can be given a string argument which is shown whilst warning for things.

We should add a string argument to most of the user-exposed ones.

I added these for everything but the operators, mostly because I'm not sure what to write there or if we need anything there.
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).