Skip to content

Commit 43437dd

Browse files
committed
Auto merge of #31489 - ben0x539:lock-to-guard, r=alexcrichton
The comment in the next line was already talking about `_guard`, and the scope guard a couple lines further down is also called `guard`, so I assume that was just a typo. r? @steveklabnik
2 parents 1cff753 + cab8c2a commit 43437dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libstd/sync/mutex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ use sys_common::poison::{self, TryLockError, TryLockResult, LockResult};
9696
/// let _ = thread::spawn(move || -> () {
9797
/// // This thread will acquire the mutex first, unwrapping the result of
9898
/// // `lock` because the lock has not been poisoned.
99-
/// let _lock = lock2.lock().unwrap();
99+
/// let _guard = lock2.lock().unwrap();
100100
///
101101
/// // This panic while holding the lock (`_guard` is in scope) will poison
102102
/// // the mutex.

0 commit comments

Comments
 (0)