@@ -3,9 +3,6 @@ use crate::fmt;
33use crate :: sync:: atomic:: { AtomicBool , Ordering } ;
44use crate :: thread;
55
6- #[ allow( unused_imports) ] // for intra-doc links
7- use crate :: sync:: { Mutex , RwLock } ;
8-
96pub struct Flag {
107 failed : AtomicBool ,
118}
@@ -80,6 +77,8 @@ pub struct Guard {
8077/// }
8178/// };
8279/// ```
80+ /// [`Mutex`]: crate::sync::Mutex
81+ /// [`RwLock`]: crate::sync::RwLock
8382#[ stable( feature = "rust1" , since = "1.0.0" ) ]
8483pub struct PoisonError < T > {
8584 guard : T ,
@@ -89,9 +88,11 @@ pub struct PoisonError<T> {
8988/// can occur while trying to acquire a lock, from the [`try_lock`] method on a
9089/// [`Mutex`] or the [`try_read`] and [`try_write`] methods on an [`RwLock`].
9190///
92- /// [`try_lock`]: Mutex::try_lock
93- /// [`try_read`]: RwLock::try_read
94- /// [`try_write`]: RwLock::try_write
91+ /// [`try_lock`]: crate::sync::Mutex::try_lock
92+ /// [`try_read`]: crate::sync::RwLock::try_read
93+ /// [`try_write`]: crate::sync::RwLock::try_write
94+ /// [`Mutex`]: crate::sync::Mutex
95+ /// [`RwLock`]: crate::sync::RwLock
9596#[ stable( feature = "rust1" , since = "1.0.0" ) ]
9697pub enum TryLockError < T > {
9798 /// The lock could not be acquired because another thread failed while holding
@@ -149,7 +150,8 @@ impl<T> Error for PoisonError<T> {
149150impl < T > PoisonError < T > {
150151 /// Creates a `PoisonError`.
151152 ///
152- /// This is generally created by methods like [`Mutex::lock`] or [`RwLock::read`].
153+ /// This is generally created by methods like [`Mutex::lock`](crate::sync::Mutex::lock)
154+ /// or [`RwLock::read`](crate::sync::RwLock::read).
153155 #[ stable( feature = "sync_poison" , since = "1.2.0" ) ]
154156 pub fn new ( guard : T ) -> PoisonError < T > {
155157 PoisonError { guard }
0 commit comments