@@ -3,9 +3,6 @@ use crate::fmt;
3
3
use crate :: sync:: atomic:: { AtomicBool , Ordering } ;
4
4
use crate :: thread;
5
5
6
- #[ allow( unused_imports) ] // for intra-doc links
7
- use crate :: sync:: { Mutex , RwLock } ;
8
-
9
6
pub struct Flag {
10
7
failed : AtomicBool ,
11
8
}
@@ -80,6 +77,8 @@ pub struct Guard {
80
77
/// }
81
78
/// };
82
79
/// ```
80
+ /// [`Mutex`]: crate::sync::Mutex
81
+ /// [`RwLock`]: crate::sync::RwLock
83
82
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
84
83
pub struct PoisonError < T > {
85
84
guard : T ,
@@ -89,9 +88,11 @@ pub struct PoisonError<T> {
89
88
/// can occur while trying to acquire a lock, from the [`try_lock`] method on a
90
89
/// [`Mutex`] or the [`try_read`] and [`try_write`] methods on an [`RwLock`].
91
90
///
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
95
96
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
96
97
pub enum TryLockError < T > {
97
98
/// The lock could not be acquired because another thread failed while holding
@@ -149,7 +150,8 @@ impl<T> Error for PoisonError<T> {
149
150
impl < T > PoisonError < T > {
150
151
/// Creates a `PoisonError`.
151
152
///
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).
153
155
#[ stable( feature = "sync_poison" , since = "1.2.0" ) ]
154
156
pub fn new ( guard : T ) -> PoisonError < T > {
155
157
PoisonError { guard }
0 commit comments