@@ -199,11 +199,17 @@ impl<T: ?Sized> RwLock<T> {
199199 ///
200200 /// # Errors
201201 ///
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
205205 /// acquired.
206206 ///
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+ ///
207213 /// # Examples
208214 ///
209215 /// ```
@@ -281,10 +287,17 @@ impl<T: ?Sized> RwLock<T> {
281287 ///
282288 /// # Errors
283289 ///
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+ ///
288301 ///
289302 /// # Examples
290303 ///
0 commit comments