diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2014-02-15 12:53:23 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2014-02-16 10:13:56 +1100 |
| commit | 0f4294b4e2887ffe9d0532564521c456bb89a780 (patch) | |
| tree | f58e94478178cdb6f81604476ad326a0e53441c7 /src/libsync/sync | |
| parent | 0937f659993631da3b3ddc198dd502c58d1634c6 (diff) | |
| download | rust-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.rs | 1 |
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, } |
