@@ -119,7 +119,9 @@ pub fn hint_core_should_pause()
119
119
120
120
/// A boolean type which can be safely shared between threads.
121
121
///
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
123
125
#[ cfg( target_has_atomic = "8" ) ]
124
126
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
125
127
pub struct AtomicBool {
@@ -246,11 +248,13 @@ impl AtomicBool {
246
248
AtomicBool { v : UnsafeCell :: new ( v as u8 ) }
247
249
}
248
250
249
- /// Returns a mutable reference to the underlying `bool`.
251
+ /// Returns a mutable reference to the underlying [ `bool`] .
250
252
///
251
253
/// This is safe because the mutable reference guarantees that no other threads are
252
254
/// concurrently accessing the atomic data.
253
255
///
256
+ /// [`bool`]: ../../../std/primitive.bool.html
257
+ ///
254
258
/// # Examples
255
259
///
256
260
/// ```
@@ -369,7 +373,7 @@ impl AtomicBool {
369
373
unsafe { atomic_swap ( self . v . get ( ) , val as u8 , order) != 0 }
370
374
}
371
375
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.
373
377
///
374
378
/// The return value is always the previous value. If it is equal to `current`, then the value
375
379
/// was updated.
@@ -378,6 +382,7 @@ impl AtomicBool {
378
382
/// ordering of this operation.
379
383
///
380
384
/// [`Ordering`]: enum.Ordering.html
385
+ /// [`bool`]: ../../../std/primitive.bool.html
381
386
///
382
387
/// # Examples
383
388
///
@@ -401,7 +406,7 @@ impl AtomicBool {
401
406
}
402
407
}
403
408
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.
405
410
///
406
411
/// The return value is a result indicating whether the new value was written and containing
407
412
/// the previous value. On success this value is guaranteed to be equal to `current`.
@@ -412,6 +417,7 @@ impl AtomicBool {
412
417
/// operation fails. The failure ordering can't be [`Release`] or [`AcqRel`] and must
413
418
/// be equivalent or weaker than the success ordering.
414
419
///
420
+ /// [`bool`]: ../../../std/primitive.bool.html
415
421
/// [`Ordering`]: enum.Ordering.html
416
422
/// [`Release`]: enum.Ordering.html#variant.Release
417
423
/// [`AcqRel`]: enum.Ordering.html#variant.Release
@@ -452,7 +458,7 @@ impl AtomicBool {
452
458
}
453
459
}
454
460
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.
456
462
///
457
463
/// Unlike [`compare_exchange`], this function is allowed to spuriously fail even when the
458
464
/// comparison succeeds, which can result in more efficient code on some platforms. The
@@ -465,6 +471,7 @@ impl AtomicBool {
465
471
/// failure ordering can't be [`Release`] or [`AcqRel`] and must be equivalent or
466
472
/// weaker than the success ordering.
467
473
///
474
+ /// [`bool`]: ../../../std/primitive.bool.html
468
475
/// [`compare_exchange`]: #method.compare_exchange
469
476
/// [`Ordering`]: enum.Ordering.html
470
477
/// [`Release`]: enum.Ordering.html#variant.Release
0 commit comments