Skip to content

Commit b472b28

Browse files
Add missing links for Arc
1 parent ee409a4 commit b472b28

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/liballoc/arc.rs

+8-5
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ const MAX_REFCOUNT: usize = (isize::MAX) as usize;
7272
/// first: after all, isn't the point of `Arc<T>` thread safety? The key is
7373
/// this: `Arc<T>` makes it thread safe to have multiple ownership of the same
7474
/// data, but it doesn't add thread safety to its data. Consider
75-
/// `Arc<RefCell<T>>`. `RefCell<T>` isn't [`Sync`], and if `Arc<T>` was always
76-
/// [`Send`], `Arc<RefCell<T>>` would be as well. But then we'd have a problem:
77-
/// `RefCell<T>` is not thread safe; it keeps track of the borrowing count using
75+
/// `Arc<`[`RefCell<T>`]`>`. [`RefCell<T>`] isn't [`Sync`], and if `Arc<T>` was always
76+
/// [`Send`], `Arc<`[`RefCell<T>`]`>` would be as well. But then we'd have a problem:
77+
/// [`RefCell<T>`] is not thread safe; it keeps track of the borrowing count using
7878
/// non-atomic operations.
7979
///
8080
/// In the end, this means that you may need to pair `Arc<T>` with some sort of
81-
/// `std::sync` type, usually `Mutex<T>`.
81+
/// [`std::sync`] type, usually [`Mutex<T>`][mutex].
8282
///
8383
/// ## Breaking cycles with `Weak`
8484
///
@@ -106,7 +106,7 @@ const MAX_REFCOUNT: usize = (isize::MAX) as usize;
106106
/// // a and b both point to the same memory location as foo.
107107
/// ```
108108
///
109-
/// The `Arc::clone(&from)` syntax is the most idiomatic because it conveys more explicitly
109+
/// The [`Arc::clone(&from)`] syntax is the most idiomatic because it conveys more explicitly
110110
/// the meaning of the code. In the example above, this syntax makes it easier to see that
111111
/// this code is creating a new reference rather than copying the whole content of foo.
112112
///
@@ -141,6 +141,9 @@ const MAX_REFCOUNT: usize = (isize::MAX) as usize;
141141
/// [upgrade]: struct.Weak.html#method.upgrade
142142
/// [`None`]: ../../std/option/enum.Option.html#variant.None
143143
/// [assoc]: ../../book/first-edition/method-syntax.html#associated-functions
144+
/// [`RefCell<T>`]: ../../std/cell/struct.RefCell.html
145+
/// [`std::sync`]: ../../std/sync/index.html
146+
/// [`Arc::clone(&from)`]: #method.clone
144147
///
145148
/// # Examples
146149
///

0 commit comments

Comments
 (0)