@@ -55,24 +55,24 @@ const MAX_REFCOUNT: usize = (isize::MAX) as usize;
55
55
/// [`RwLock`][rwlock], or one of the [`Atomic`][atomic] types.
56
56
///
57
57
/// `Arc` uses atomic operations for reference counting, so `Arc`s can be
58
- /// sent between threads. In other words, `Arc<T>` implements [`Send`][send]
59
- /// as long as `T` implements `Send` and [`Sync`][sync]. The disadvantage is
58
+ /// sent between threads. In other words, `Arc<T>` implements [`Send`]
59
+ /// as long as `T` implements [ `Send`] and [`Sync`][sync]. The disadvantage is
60
60
/// that atomic operations are more expensive than ordinary memory accesses.
61
61
/// If you are not sharing reference-counted values between threads, consider
62
- /// using [`rc::Rc`][rc] for lower overhead. `Rc` is a safe default, because
63
- /// the compiler will catch any attempt to send an `Rc` between threads.
62
+ /// using [`rc::Rc`] for lower overhead. [ `Rc`] is a safe default, because
63
+ /// the compiler will catch any attempt to send an [ `Rc`] between threads.
64
64
/// However, a library might choose `Arc` in order to give library consumers
65
65
/// more flexibility.
66
66
///
67
67
/// The [`downgrade`][downgrade] method can be used to create a non-owning
68
- /// [`Weak`][weak] pointer. A `Weak` pointer can be [`upgrade`][upgrade]d
69
- /// to an `Arc`, but this will return [`None`][option] if the value has
70
- /// already been dropped.
68
+ /// [`Weak`][weak] pointer. A [ `Weak`][weak] pointer can be [`upgrade`][upgrade]d
69
+ /// to an `Arc`, but this will return [`None`] if the value has already been
70
+ /// dropped.
71
71
///
72
72
/// A cycle between `Arc` pointers will never be deallocated. For this reason,
73
- /// `Weak` is used to break cycles. For example, a tree could have strong
74
- /// `Arc` pointers from parent nodes to children, and `Weak` pointers from
75
- /// children back to their parents.
73
+ /// [ `Weak`][weak] is used to break cycles. For example, a tree could have
74
+ /// strong `Arc` pointers from parent nodes to children, and [ `Weak`][weak]
75
+ /// pointers from children back to their parents.
76
76
///
77
77
/// `Arc<T>` automatically dereferences to `T` (via the [`Deref`][deref] trait),
78
78
/// so you can call `T`'s methods on a value of type `Arc<T>`. To avoid name
@@ -86,22 +86,22 @@ const MAX_REFCOUNT: usize = (isize::MAX) as usize;
86
86
/// Arc::downgrade(&my_arc);
87
87
/// ```
88
88
///
89
- /// `Weak<T>` does not auto-dereference to `T`, because the value may have
89
+ /// [ `Weak<T>`][weak] does not auto-dereference to `T`, because the value may have
90
90
/// already been destroyed.
91
91
///
92
92
/// [arc]: struct.Arc.html
93
93
/// [weak]: struct.Weak.html
94
- /// [rc ]: ../../std/rc/struct.Rc.html
94
+ /// [`Rc` ]: ../../std/rc/struct.Rc.html
95
95
/// [clone]: ../../std/clone/trait.Clone.html#tymethod.clone
96
96
/// [mutex]: ../../std/sync/struct.Mutex.html
97
97
/// [rwlock]: ../../std/sync/struct.RwLock.html
98
98
/// [atomic]: ../../std/sync/atomic/index.html
99
- /// [send ]: ../../std/marker/trait.Send.html
99
+ /// [`Send` ]: ../../std/marker/trait.Send.html
100
100
/// [sync]: ../../std/marker/trait.Sync.html
101
101
/// [deref]: ../../std/ops/trait.Deref.html
102
102
/// [downgrade]: struct.Arc.html#method.downgrade
103
103
/// [upgrade]: struct.Weak.html#method.upgrade
104
- /// [option ]: ../../std/option/enum.Option.html
104
+ /// [`None` ]: ../../std/option/enum.Option.html#variant.None
105
105
/// [assoc]: ../../book/method-syntax.html#associated-functions
106
106
///
107
107
/// # Examples
@@ -127,7 +127,9 @@ const MAX_REFCOUNT: usize = (isize::MAX) as usize;
127
127
/// }
128
128
/// ```
129
129
///
130
- /// Sharing a mutable `AtomicUsize`:
130
+ /// Sharing a mutable [`AtomicUsize`]:
131
+ ///
132
+ /// [`AtomicUsize`]: ../../std/sync/atomic/struct.AtomicUsize.html
131
133
///
132
134
/// ```no_run
133
135
/// use std::sync::Arc;
0 commit comments