Skip to content

Commit 98045fd

Browse files
committedOct 5, 2017
Add missing links for AtomicBool
1 parent 0f0f5db commit 98045fd

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed
 

‎src/libcore/sync/atomic.rs

+12-5
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ pub fn hint_core_should_pause()
119119

120120
/// A boolean type which can be safely shared between threads.
121121
///
122-
/// This type has the same in-memory representation as a `bool`.
122+
/// This type has the same in-memory representation as a [`bool`].
123+
///
124+
/// [`bool`]: ../../../std/primitive.bool.html
123125
#[cfg(target_has_atomic = "8")]
124126
#[stable(feature = "rust1", since = "1.0.0")]
125127
pub struct AtomicBool {
@@ -246,11 +248,13 @@ impl AtomicBool {
246248
AtomicBool { v: UnsafeCell::new(v as u8) }
247249
}
248250

249-
/// Returns a mutable reference to the underlying `bool`.
251+
/// Returns a mutable reference to the underlying [`bool`].
250252
///
251253
/// This is safe because the mutable reference guarantees that no other threads are
252254
/// concurrently accessing the atomic data.
253255
///
256+
/// [`bool`]: ../../../std/primitive.bool.html
257+
///
254258
/// # Examples
255259
///
256260
/// ```
@@ -369,7 +373,7 @@ impl AtomicBool {
369373
unsafe { atomic_swap(self.v.get(), val as u8, order) != 0 }
370374
}
371375

372-
/// Stores a value into the `bool` if the current value is the same as the `current` value.
376+
/// Stores a value into the [`bool`] if the current value is the same as the `current` value.
373377
///
374378
/// The return value is always the previous value. If it is equal to `current`, then the value
375379
/// was updated.
@@ -378,6 +382,7 @@ impl AtomicBool {
378382
/// ordering of this operation.
379383
///
380384
/// [`Ordering`]: enum.Ordering.html
385+
/// [`bool`]: ../../../std/primitive.bool.html
381386
///
382387
/// # Examples
383388
///
@@ -401,7 +406,7 @@ impl AtomicBool {
401406
}
402407
}
403408

404-
/// Stores a value into the `bool` if the current value is the same as the `current` value.
409+
/// Stores a value into the [`bool`] if the current value is the same as the `current` value.
405410
///
406411
/// The return value is a result indicating whether the new value was written and containing
407412
/// the previous value. On success this value is guaranteed to be equal to `current`.
@@ -412,6 +417,7 @@ impl AtomicBool {
412417
/// operation fails. The failure ordering can't be [`Release`] or [`AcqRel`] and must
413418
/// be equivalent or weaker than the success ordering.
414419
///
420+
/// [`bool`]: ../../../std/primitive.bool.html
415421
/// [`Ordering`]: enum.Ordering.html
416422
/// [`Release`]: enum.Ordering.html#variant.Release
417423
/// [`AcqRel`]: enum.Ordering.html#variant.Release
@@ -452,7 +458,7 @@ impl AtomicBool {
452458
}
453459
}
454460

455-
/// Stores a value into the `bool` if the current value is the same as the `current` value.
461+
/// Stores a value into the [`bool`] if the current value is the same as the `current` value.
456462
///
457463
/// Unlike [`compare_exchange`], this function is allowed to spuriously fail even when the
458464
/// comparison succeeds, which can result in more efficient code on some platforms. The
@@ -465,6 +471,7 @@ impl AtomicBool {
465471
/// failure ordering can't be [`Release`] or [`AcqRel`] and must be equivalent or
466472
/// weaker than the success ordering.
467473
///
474+
/// [`bool`]: ../../../std/primitive.bool.html
468475
/// [`compare_exchange`]: #method.compare_exchange
469476
/// [`Ordering`]: enum.Ordering.html
470477
/// [`Release`]: enum.Ordering.html#variant.Release

0 commit comments

Comments
 (0)
Please sign in to comment.