Skip to content

Commit 0f4294b

Browse files
committed
sync: Add #[must_use] to the Mutex guard.
This helps people remember to save the return value to keep the mutex locked as appropriate.
1 parent 0937f65 commit 0f4294b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/libsync/sync/mutex.rs

+1
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ pub struct StaticMutex {
143143

144144
/// An RAII implementation of a "scoped lock" of a mutex. When this structure is
145145
/// dropped (falls out of scope), the lock will be unlocked.
146+
#[must_use]
146147
pub struct Guard<'a> {
147148
priv lock: &'a mut StaticMutex,
148149
}

0 commit comments

Comments
 (0)