Skip to content

Commit 8b8ab85

Browse files
authored
Rollup merge of rust-lang#38635 - GuillaumeGomez:atomicptr_docs, r=frewsxcv
Add missing urls for AtomicPtr r? @frewsxcv
2 parents 6ccf039 + ef8d5e1 commit 8b8ab85

File tree

1 file changed

+37
-14
lines changed

1 file changed

+37
-14
lines changed

src/libcore/sync/atomic.rs

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -641,11 +641,16 @@ impl<T> AtomicPtr<T> {
641641

642642
/// Loads a value from the pointer.
643643
///
644-
/// `load` takes an `Ordering` argument which describes the memory ordering of this operation.
644+
/// `load` takes an [`Ordering`] argument which describes the memory ordering
645+
/// of this operation.
645646
///
646647
/// # Panics
647648
///
648-
/// Panics if `order` is `Release` or `AcqRel`.
649+
/// Panics if `order` is [`Release`] or [`AcqRel`].
650+
///
651+
/// [`Ordering`]: enum.Ordering.html
652+
/// [`Release`]: enum.Ordering.html#variant.Release
653+
/// [`AcqRel`]: enum.Ordering.html#variant.AcqRel
649654
///
650655
/// # Examples
651656
///
@@ -665,7 +670,10 @@ impl<T> AtomicPtr<T> {
665670

666671
/// Stores a value into the pointer.
667672
///
668-
/// `store` takes an `Ordering` argument which describes the memory ordering of this operation.
673+
/// `store` takes an [`Ordering`] argument which describes the memory ordering
674+
/// of this operation.
675+
///
676+
/// [`Ordering`]: enum.Ordering.html
669677
///
670678
/// # Examples
671679
///
@@ -693,7 +701,10 @@ impl<T> AtomicPtr<T> {
693701

694702
/// Stores a value into the pointer, returning the old value.
695703
///
696-
/// `swap` takes an `Ordering` argument which describes the memory ordering of this operation.
704+
/// `swap` takes an [`Ordering`] argument which describes the memory ordering
705+
/// of this operation.
706+
///
707+
/// [`Ordering`]: enum.Ordering.html
697708
///
698709
/// # Examples
699710
///
@@ -718,8 +729,10 @@ impl<T> AtomicPtr<T> {
718729
/// The return value is always the previous value. If it is equal to `current`, then the value
719730
/// was updated.
720731
///
721-
/// `compare_and_swap` also takes an `Ordering` argument which describes the memory ordering of
722-
/// this operation.
732+
/// `compare_and_swap` also takes an [`Ordering`] argument which describes the memory
733+
/// ordering of this operation.
734+
///
735+
/// [`Ordering`]: enum.Ordering.html
723736
///
724737
/// # Examples
725738
///
@@ -748,10 +761,15 @@ impl<T> AtomicPtr<T> {
748761
/// The return value is a result indicating whether the new value was written and containing
749762
/// the previous value. On success this value is guaranteed to be equal to `current`.
750763
///
751-
/// `compare_exchange` takes two `Ordering` arguments to describe the memory ordering of this
752-
/// operation. The first describes the required ordering if the operation succeeds while the
753-
/// second describes the required ordering when the operation fails. The failure ordering can't
754-
/// be `Release` or `AcqRel` and must be equivalent or weaker than the success ordering.
764+
/// `compare_exchange` takes two [`Ordering`] arguments to describe the memory
765+
/// ordering of this operation. The first describes the required ordering if
766+
/// the operation succeeds while the second describes the required ordering when
767+
/// the operation fails. The failure ordering can't be [`Release`] or [`AcqRel`]
768+
/// and must be equivalent or weaker than the success ordering.
769+
///
770+
/// [`Ordering`]: enum.Ordering.html
771+
/// [`Release`]: enum.Ordering.html#variant.Release
772+
/// [`AcqRel`]: enum.Ordering.html#variant.AcqRel
755773
///
756774
/// # Examples
757775
///
@@ -790,16 +808,21 @@ impl<T> AtomicPtr<T> {
790808

791809
/// Stores a value into the pointer if the current value is the same as the `current` value.
792810
///
793-
/// Unlike `compare_exchange`, this function is allowed to spuriously fail even when the
811+
/// Unlike [`compare_exchange`], this function is allowed to spuriously fail even when the
794812
/// comparison succeeds, which can result in more efficient code on some platforms. The
795813
/// return value is a result indicating whether the new value was written and containing the
796814
/// previous value.
797815
///
798-
/// `compare_exchange_weak` takes two `Ordering` arguments to describe the memory
816+
/// `compare_exchange_weak` takes two [`Ordering`] arguments to describe the memory
799817
/// ordering of this operation. The first describes the required ordering if the operation
800818
/// succeeds while the second describes the required ordering when the operation fails. The
801-
/// failure ordering can't be `Release` or `AcqRel` and must be equivalent or weaker than the
802-
/// success ordering.
819+
/// failure ordering can't be [`Release`] or [`AcqRel`] and must be equivalent or
820+
/// weaker than the success ordering.
821+
///
822+
/// [`compare_exchange`]: #method.compare_exchange
823+
/// [`Ordering`]: enum.Ordering.html
824+
/// [`Release`]: enum.Ordering.html#variant.Release
825+
/// [`AcqRel`]: enum.Ordering.html#variant.AcqRel
803826
///
804827
/// # Examples
805828
///

0 commit comments

Comments
 (0)