@@ -199,11 +199,17 @@ impl<T: ?Sized> RwLock<T> {
199
199
///
200
200
/// # Errors
201
201
///
202
- /// This function will return an error if the RwLock is poisoned. An RwLock
203
- /// is poisoned whenever a writer panics while holding an exclusive lock. An
204
- /// error will only be returned if the lock would have otherwise been
202
+ /// This function will return the error [`Poisoned`] if the RwLock is poisoned.
203
+ /// An RwLock is poisoned whenever a writer panics while holding an exclusive
204
+ /// lock. `Poisoned` will only be returned if the lock would have otherwise been
205
205
/// acquired.
206
206
///
207
+ /// This function will return the error [`WouldBlock`] if the RwLock could not
208
+ /// be acquired because it was already locked exclusively.
209
+ ///
210
+ /// [`Poisoned`]: TryLockError::Poisoned
211
+ /// [`WouldBlock`]: TryLockError::WouldBlock
212
+ ///
207
213
/// # Examples
208
214
///
209
215
/// ```
@@ -281,10 +287,17 @@ impl<T: ?Sized> RwLock<T> {
281
287
///
282
288
/// # Errors
283
289
///
284
- /// This function will return an error if the RwLock is poisoned. An RwLock
285
- /// is poisoned whenever a writer panics while holding an exclusive lock. An
286
- /// error will only be returned if the lock would have otherwise been
287
- /// acquired.
290
+ /// This function will return the error [`Poisoned`] if the RwLock is
291
+ /// poisoned. An RwLock is poisoned whenever a writer panics while holding
292
+ /// an exclusive lock. `Poisoned` will only be returned if the lock would have
293
+ /// otherwise been acquired.
294
+ ///
295
+ /// This function will return the error [`WouldBlock`] if the RwLock could not
296
+ /// be acquired because it was already locked exclusively.
297
+ ///
298
+ /// [`Poisoned`]: TryLockError::Poisoned
299
+ /// [`WouldBlock`]: TryLockError::WouldBlock
300
+ ///
288
301
///
289
302
/// # Examples
290
303
///
0 commit comments