Skip to content

Commit 3c8a17f

Browse files
authored
Rollup merge of rust-lang#38649 - GuillaumeGomez:atomicint_docs, r=frewsxcv
Add missing urls for atomic_int macros types r? @frewsxcv
2 parents 332a4cc + 94d58c2 commit 3c8a17f

File tree

1 file changed

+36
-17
lines changed

1 file changed

+36
-17
lines changed

src/libcore/sync/atomic.rs

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -958,12 +958,16 @@ macro_rules! atomic_int {
958958

959959
/// Loads a value from the atomic integer.
960960
///
961-
/// `load` takes an `Ordering` argument which describes the memory ordering of this
961+
/// `load` takes an [`Ordering`] argument which describes the memory ordering of this
962962
/// operation.
963963
///
964964
/// # Panics
965965
///
966-
/// Panics if `order` is `Release` or `AcqRel`.
966+
/// Panics if `order` is [`Release`] or [`AcqRel`].
967+
///
968+
/// [`Ordering`]: enum.Ordering.html
969+
/// [`Release`]: enum.Ordering.html#variant.Release
970+
/// [`AcqRel`]: enum.Ordering.html#variant.AcqRel
967971
///
968972
/// # Examples
969973
///
@@ -982,9 +986,11 @@ macro_rules! atomic_int {
982986

983987
/// Stores a value into the atomic integer.
984988
///
985-
/// `store` takes an `Ordering` argument which describes the memory ordering of this
989+
/// `store` takes an [`Ordering`] argument which describes the memory ordering of this
986990
/// operation.
987991
///
992+
/// [`Ordering`]: enum.Ordering.html
993+
///
988994
/// # Examples
989995
///
990996
/// ```
@@ -1007,9 +1013,11 @@ macro_rules! atomic_int {
10071013

10081014
/// Stores a value into the atomic integer, returning the old value.
10091015
///
1010-
/// `swap` takes an `Ordering` argument which describes the memory ordering of this
1016+
/// `swap` takes an [`Ordering`] argument which describes the memory ordering of this
10111017
/// operation.
10121018
///
1019+
/// [`Ordering`]: enum.Ordering.html
1020+
///
10131021
/// # Examples
10141022
///
10151023
/// ```
@@ -1031,9 +1039,11 @@ macro_rules! atomic_int {
10311039
/// The return value is always the previous value. If it is equal to `current`, then the
10321040
/// value was updated.
10331041
///
1034-
/// `compare_and_swap` also takes an `Ordering` argument which describes the memory
1042+
/// `compare_and_swap` also takes an [`Ordering`] argument which describes the memory
10351043
/// ordering of this operation.
10361044
///
1045+
/// [`Ordering`]: enum.Ordering.html
1046+
///
10371047
/// # Examples
10381048
///
10391049
/// ```
@@ -1069,11 +1079,15 @@ macro_rules! atomic_int {
10691079
/// containing the previous value. On success this value is guaranteed to be equal to
10701080
/// `current`.
10711081
///
1072-
/// `compare_exchange` takes two `Ordering` arguments to describe the memory ordering of
1073-
/// this operation. The first describes the required ordering if the operation succeeds
1074-
/// while the second describes the required ordering when the operation fails. The
1075-
/// failure ordering can't be `Release` or `AcqRel` and must be equivalent or weaker
1076-
/// than the success ordering.
1082+
/// `compare_exchange` takes two [`Ordering`] arguments to describe the memory
1083+
/// ordering of this operation. The first describes the required ordering if
1084+
/// the operation succeeds while the second describes the required ordering when
1085+
/// the operation fails. The failure ordering can't be [`Release`] or [`AcqRel`] and
1086+
/// must be equivalent or weaker than the success ordering.
1087+
///
1088+
/// [`Ordering`]: enum.Ordering.html
1089+
/// [`Release`]: enum.Ordering.html#variant.Release
1090+
/// [`AcqRel`]: enum.Ordering.html#variant.AcqRel
10771091
///
10781092
/// # Examples
10791093
///
@@ -1107,16 +1121,21 @@ macro_rules! atomic_int {
11071121
/// Stores a value into the atomic integer if the current value is the same as the
11081122
/// `current` value.
11091123
///
1110-
/// Unlike `compare_exchange`, this function is allowed to spuriously fail even when the
1111-
/// comparison succeeds, which can result in more efficient code on some platforms. The
1112-
/// return value is a result indicating whether the new value was written and containing
1113-
/// the previous value.
1124+
/// Unlike [`compare_exchange`], this function is allowed to spuriously fail even
1125+
/// when the comparison succeeds, which can result in more efficient code on some
1126+
/// platforms. The return value is a result indicating whether the new value was
1127+
/// written and containing the previous value.
11141128
///
1115-
/// `compare_exchange_weak` takes two `Ordering` arguments to describe the memory
1129+
/// `compare_exchange_weak` takes two [`Ordering`] arguments to describe the memory
11161130
/// ordering of this operation. The first describes the required ordering if the
11171131
/// operation succeeds while the second describes the required ordering when the
1118-
/// operation fails. The failure ordering can't be `Release` or `AcqRel` and must be
1119-
/// equivalent or weaker than the success ordering.
1132+
/// operation fails. The failure ordering can't be [`Release`] or [`AcqRel`] and
1133+
/// must be equivalent or weaker than the success ordering.
1134+
///
1135+
/// [`compare_exchange`]: #method.compare_exchange
1136+
/// [`Ordering`]: enum.Ordering.html
1137+
/// [`Release`]: enum.Ordering.html#variant.Release
1138+
/// [`AcqRel`]: enum.Ordering.html#variant.AcqRel
11201139
///
11211140
/// # Examples
11221141
///

0 commit comments

Comments
 (0)