diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2016-12-24 10:51:46 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2016-12-24 10:51:46 +0100 |
| commit | f4bd94f779f3e3815ba9d68dd1d39a224cce8760 (patch) | |
| tree | ece52f7fecffe39c8e5ab4062f8c854725e6f0aa /src/liballoc | |
| parent | 1b38776c1f68c6fd47c1b2f7b7974efc7dd64901 (diff) | |
| download | rust-f4bd94f779f3e3815ba9d68dd1d39a224cce8760.tar.gz rust-f4bd94f779f3e3815ba9d68dd1d39a224cce8760.zip | |
Add missing urls in Arc docs
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/arc.rs | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 1cad8f7f407..e1a240a0d2e 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -55,24 +55,24 @@ const MAX_REFCOUNT: usize = (isize::MAX) as usize; /// [`RwLock`][rwlock], or one of the [`Atomic`][atomic] types. /// /// `Arc` uses atomic operations for reference counting, so `Arc`s can be -/// sent between threads. In other words, `Arc<T>` implements [`Send`][send] -/// as long as `T` implements `Send` and [`Sync`][sync]. The disadvantage is +/// sent between threads. In other words, `Arc<T>` implements [`Send`] +/// as long as `T` implements [`Send`] and [`Sync`][sync]. The disadvantage is /// that atomic operations are more expensive than ordinary memory accesses. /// If you are not sharing reference-counted values between threads, consider -/// using [`rc::Rc`][rc] for lower overhead. `Rc` is a safe default, because -/// the compiler will catch any attempt to send an `Rc` between threads. +/// using [`rc::Rc`] for lower overhead. [`Rc`] is a safe default, because +/// the compiler will catch any attempt to send an [`Rc`] between threads. /// However, a library might choose `Arc` in order to give library consumers /// more flexibility. /// /// The [`downgrade`][downgrade] method can be used to create a non-owning -/// [`Weak`][weak] pointer. A `Weak` pointer can be [`upgrade`][upgrade]d -/// to an `Arc`, but this will return [`None`][option] if the value has -/// already been dropped. +/// [`Weak`][weak] pointer. A [`Weak`][weak] pointer can be [`upgrade`][upgrade]d +/// to an `Arc`, but this will return [`None`] if the value has already been +/// dropped. /// /// A cycle between `Arc` pointers will never be deallocated. For this reason, -/// `Weak` is used to break cycles. For example, a tree could have strong -/// `Arc` pointers from parent nodes to children, and `Weak` pointers from -/// children back to their parents. +/// [`Weak`][weak] is used to break cycles. For example, a tree could have +/// strong `Arc` pointers from parent nodes to children, and [`Weak`][weak] +/// pointers from children back to their parents. /// /// `Arc<T>` automatically dereferences to `T` (via the [`Deref`][deref] trait), /// 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; /// Arc::downgrade(&my_arc); /// ``` /// -/// `Weak<T>` does not auto-dereference to `T`, because the value may have +/// [`Weak<T>`][weak] does not auto-dereference to `T`, because the value may have /// already been destroyed. /// /// [arc]: struct.Arc.html /// [weak]: struct.Weak.html -/// [rc]: ../../std/rc/struct.Rc.html +/// [`Rc`]: ../../std/rc/struct.Rc.html /// [clone]: ../../std/clone/trait.Clone.html#tymethod.clone /// [mutex]: ../../std/sync/struct.Mutex.html /// [rwlock]: ../../std/sync/struct.RwLock.html /// [atomic]: ../../std/sync/atomic/index.html -/// [send]: ../../std/marker/trait.Send.html +/// [`Send`]: ../../std/marker/trait.Send.html /// [sync]: ../../std/marker/trait.Sync.html /// [deref]: ../../std/ops/trait.Deref.html /// [downgrade]: struct.Arc.html#method.downgrade /// [upgrade]: struct.Weak.html#method.upgrade -/// [option]: ../../std/option/enum.Option.html +/// [`None`]: ../../std/option/enum.Option.html#variant.None /// [assoc]: ../../book/method-syntax.html#associated-functions /// /// # Examples @@ -127,7 +127,9 @@ const MAX_REFCOUNT: usize = (isize::MAX) as usize; /// } /// ``` /// -/// Sharing a mutable `AtomicUsize`: +/// Sharing a mutable [`AtomicUsize`]: +/// +/// [`AtomicUsize`]: ../../std/sync/atomic/struct.AtomicUsize.html /// /// ```no_run /// use std::sync::Arc; |
