Skip to content

Commit c5ac143

Browse files
Rollup merge of #142967 - krikera:fix-rwlock-try-write-docs, r=jhpratt
Fix RwLock::try_write documentation for WouldBlock condition Fix RwLock::try_write documentation for WouldBlock condition The documentation incorrectly stated that try_write only fails when 'already locked exclusively', but it actually fails when there are either shared (read) or exclusive (write) locks. Fixes #142852
2 parents d712024 + 7a70f64 commit c5ac143

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/std/src/sync/poison/rwlock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ impl<T: ?Sized> RwLock<T> {
481481
/// in the returned error.
482482
///
483483
/// This function will return the [`WouldBlock`] error if the `RwLock` could
484-
/// not be acquired because it was already locked exclusively.
484+
/// not be acquired because it was already locked.
485485
///
486486
/// [`Poisoned`]: TryLockError::Poisoned
487487
/// [`WouldBlock`]: TryLockError::WouldBlock

0 commit comments

Comments
 (0)