about summary refs log tree commit diff
path: root/src/libsync/sync
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2014-02-15 12:53:23 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2014-02-16 10:13:56 +1100
commit0f4294b4e2887ffe9d0532564521c456bb89a780 (patch)
treef58e94478178cdb6f81604476ad326a0e53441c7 /src/libsync/sync
parent0937f659993631da3b3ddc198dd502c58d1634c6 (diff)
downloadrust-0f4294b4e2887ffe9d0532564521c456bb89a780.tar.gz
rust-0f4294b4e2887ffe9d0532564521c456bb89a780.zip
sync: Add `#[must_use]` to the Mutex guard.
This helps people remember to save the return value to keep the mutex
locked as appropriate.
Diffstat (limited to 'src/libsync/sync')
-rw-r--r--src/libsync/sync/mutex.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libsync/sync/mutex.rs b/src/libsync/sync/mutex.rs
index b37e2f3a45d..2bd85526e68 100644
--- a/src/libsync/sync/mutex.rs
+++ b/src/libsync/sync/mutex.rs
@@ -143,6 +143,7 @@ pub struct StaticMutex {
 
 /// An RAII implementation of a "scoped lock" of a mutex. When this structure is
 /// dropped (falls out of scope), the lock will be unlocked.
+#[must_use]
 pub struct Guard<'a> {
     priv lock: &'a mut StaticMutex,
 }