Skip to content

Commit 4ea03c8

Browse files
committed
Fixing formatting issues #29377
1 parent 756f224 commit 4ea03c8

File tree

1 file changed

+42
-38
lines changed

1 file changed

+42
-38
lines changed

src/libcore/sync/atomic.rs

+42-38
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
//! atomically-reference-counted shared pointer).
4040
//!
4141
//! [`Sync`]: ../../marker/trait.Sync.html
42-
//! [arc]: ../struct.Arc.html
42+
//! [arc]: ../../../std/sync/struct.Arc.html
4343
//!
4444
//! Most atomic types may be stored in static variables, initialized using
4545
//! the provided static initializers like [`ATOMIC_BOOL_INIT`]. Atomic statics
@@ -158,27 +158,32 @@ unsafe impl<T> Sync for AtomicPtr<T> {}
158158
#[stable(feature = "rust1", since = "1.0.0")]
159159
#[derive(Copy, Clone, Debug)]
160160
pub enum Ordering {
161-
/// No ordering constraints, only atomic operations. Corresponds to LLVM's
162-
/// [`Monotonic`][1] ordering.
163-
/// [1]: http://llvm.org/docs/Atomics.html#monotonic
161+
/// No ordering constraints, only atomic operations.
162+
///
163+
/// Corresponds to LLVM's [`Monotonic`] ordering.
164+
///
165+
/// [`Monotonic`]: http://llvm.org/docs/Atomics.html#monotonic
164166
#[stable(feature = "rust1", since = "1.0.0")]
165167
Relaxed,
166168
/// When coupled with a store, all previous writes become visible
167-
/// to the other threads that perform a load with [`Acquire`][1] ordering
169+
/// to the other threads that perform a load with [`Acquire`] ordering
168170
/// on the same value.
169-
/// [1]: http://llvm.org/docs/Atomics.html#acquire
171+
///
172+
/// [`Acquire`]: http://llvm.org/docs/Atomics.html#acquire
170173
#[stable(feature = "rust1", since = "1.0.0")]
171174
Release,
172175
/// When coupled with a load, all subsequent loads will see data
173-
/// written before a store with [`Release`][1] ordering on the same value
176+
/// written before a store with [`Release`] ordering on the same value
174177
/// in other threads.
175-
/// [1]: http://llvm.org/docs/Atomics.html#release
178+
///
179+
/// [`Release`]: http://llvm.org/docs/Atomics.html#release
176180
#[stable(feature = "rust1", since = "1.0.0")]
177181
Acquire,
178-
/// When coupled with a load, uses [`Acquire`][1] ordering, and with a store
179-
/// [`Release`][2] ordering.
180-
/// [1]: http://llvm.org/docs/Atomics.html#acquire
181-
/// [2]: http://llvm.org/docs/Atomics.html#release
182+
/// When coupled with a load, uses [`Acquire`] ordering, and with a store
183+
/// [`Release`] ordering.
184+
///
185+
/// [`Acquire`]: http://llvm.org/docs/Atomics.html#acquire
186+
/// [`Release`]: http://llvm.org/docs/Atomics.html#release
182187
#[stable(feature = "rust1", since = "1.0.0")]
183188
AcqRel,
184189
/// Like `AcqRel` with the additional guarantee that all threads see all
@@ -192,6 +197,7 @@ pub enum Ordering {
192197
}
193198

194199
/// An [`AtomicBool`] initialized to `false`.
200+
///
195201
/// [`AtomicBool`]: struct.AtomicBool.html
196202
#[cfg(target_has_atomic = "8")]
197203
#[stable(feature = "rust1", since = "1.0.0")]
@@ -257,7 +263,7 @@ impl AtomicBool {
257263

258264
/// Loads a value from the bool.
259265
///
260-
/// `load()` takes an [`Ordering`] argument which describes the memory ordering
266+
/// `load` takes an [`Ordering`] argument which describes the memory ordering
261267
/// of this operation.
262268
///
263269
/// # Panics
@@ -285,7 +291,7 @@ impl AtomicBool {
285291

286292
/// Stores a value into the bool.
287293
///
288-
/// `store()` takes an [`Ordering`] argument which describes the memory ordering
294+
/// `store` takes an [`Ordering`] argument which describes the memory ordering
289295
/// of this operation.
290296
///
291297
/// [`Ordering`]: enum.Ordering.html
@@ -317,7 +323,7 @@ impl AtomicBool {
317323

318324
/// Stores a value into the bool, returning the old value.
319325
///
320-
/// `swap()` takes an [`Ordering`] argument which describes the memory ordering
326+
/// `swap` takes an [`Ordering`] argument which describes the memory ordering
321327
/// of this operation.
322328
///
323329
/// [`Ordering`]: enum.Ordering.html
@@ -343,7 +349,7 @@ impl AtomicBool {
343349
/// The return value is always the previous value. If it is equal to `current`, then the value
344350
/// was updated.
345351
///
346-
/// `compare_and_swap()` also takes an [`Ordering`] argument which describes the memory
352+
/// `compare_and_swap` also takes an [`Ordering`] argument which describes the memory
347353
/// ordering of this operation.
348354
///
349355
/// [`Ordering`]: enum.Ordering.html
@@ -375,7 +381,7 @@ impl AtomicBool {
375381
/// The return value is a result indicating whether the new value was written and containing
376382
/// the previous value. On success this value is guaranteed to be equal to `current`.
377383
///
378-
/// `compare_exchange()` takes two [`Ordering`] arguments to describe the memory
384+
/// `compare_exchange` takes two [`Ordering`] arguments to describe the memory
379385
/// ordering of this operation. The first describes the required ordering if the
380386
/// operation succeeds while the second describes the required ordering when the
381387
/// operation fails. The failure ordering can't be [`Release`] or [`AcqRel`] and must
@@ -423,18 +429,18 @@ impl AtomicBool {
423429

424430
/// Stores a value into the `bool` if the current value is the same as the `current` value.
425431
///
426-
/// Unlike [`compare_exchange()`], this function is allowed to spuriously fail even when the
432+
/// Unlike [`compare_exchange`], this function is allowed to spuriously fail even when the
427433
/// comparison succeeds, which can result in more efficient code on some platforms. The
428434
/// return value is a result indicating whether the new value was written and containing the
429435
/// previous value.
430436
///
431-
/// `compare_exchange_weak()` takes two [`Ordering`] arguments to describe the memory
437+
/// `compare_exchange_weak` takes two [`Ordering`] arguments to describe the memory
432438
/// ordering of this operation. The first describes the required ordering if the operation
433439
/// succeeds while the second describes the required ordering when the operation fails. The
434440
/// failure ordering can't be [`Release`] or [`AcqRel`] and must be equivalent or
435441
/// weaker than the success ordering.
436442
///
437-
/// [`compare_exchange()`]: #method.compare_exchange
443+
/// [`compare_exchange`]: #method.compare_exchange
438444
/// [`Ordering`]: enum.Ordering.html
439445
/// [`Release`]: enum.Ordering.html#variant.Release
440446
/// [`AcqRel`]: enum.Ordering.html#variant.Release
@@ -665,7 +671,7 @@ impl<T> AtomicPtr<T> {
665671

666672
/// Loads a value from the pointer.
667673
///
668-
/// `load()` takes an [`Ordering`] argument which describes the memory ordering
674+
/// `load` takes an [`Ordering`] argument which describes the memory ordering
669675
/// of this operation.
670676
///
671677
/// # Panics
@@ -694,7 +700,7 @@ impl<T> AtomicPtr<T> {
694700

695701
/// Stores a value into the pointer.
696702
///
697-
/// `store()` takes an [`Ordering`] argument which describes the memory ordering
703+
/// `store` takes an [`Ordering`] argument which describes the memory ordering
698704
/// of this operation.
699705
///
700706
/// [`Ordering`]: enum.Ordering.html
@@ -718,7 +724,6 @@ impl<T> AtomicPtr<T> {
718724
///
719725
/// [`Acquire`]: enum.Ordering.html#variant.Acquire
720726
/// [`AcqRel`]: enum.Ordering.html#variant.AcqRel
721-
///
722727
#[inline]
723728
#[stable(feature = "rust1", since = "1.0.0")]
724729
pub fn store(&self, ptr: *mut T, order: Ordering) {
@@ -729,7 +734,7 @@ impl<T> AtomicPtr<T> {
729734

730735
/// Stores a value into the pointer, returning the old value.
731736
///
732-
/// `swap()` takes an [`Ordering`] argument which describes the memory ordering
737+
/// `swap` takes an [`Ordering`] argument which describes the memory ordering
733738
/// of this operation.
734739
///
735740
/// [`Ordering`]: enum.Ordering.html
@@ -757,7 +762,7 @@ impl<T> AtomicPtr<T> {
757762
/// The return value is always the previous value. If it is equal to `current`, then the value
758763
/// was updated.
759764
///
760-
/// `compare_and_swap()` also takes an [`Ordering`] argument which describes the memory
765+
/// `compare_and_swap` also takes an [`Ordering`] argument which describes the memory
761766
/// ordering of this operation.
762767
///
763768
/// [`Ordering`]: enum.Ordering.html
@@ -789,7 +794,7 @@ impl<T> AtomicPtr<T> {
789794
/// The return value is a result indicating whether the new value was written and containing
790795
/// the previous value. On success this value is guaranteed to be equal to `current`.
791796
///
792-
/// `compare_exchange()` takes two [`Ordering`] arguments to describe the memory
797+
/// `compare_exchange` takes two [`Ordering`] arguments to describe the memory
793798
/// ordering of this operation. The first describes the required ordering if
794799
/// the operation succeeds while the second describes the required ordering when
795800
/// the operation fails. The failure ordering can't be [`Release`] or [`AcqRel`]
@@ -836,18 +841,18 @@ impl<T> AtomicPtr<T> {
836841

837842
/// Stores a value into the pointer if the current value is the same as the `current` value.
838843
///
839-
/// Unlike [`compare_exchange()`], this function is allowed to spuriously fail even when the
844+
/// Unlike [`compare_exchange`], this function is allowed to spuriously fail even when the
840845
/// comparison succeeds, which can result in more efficient code on some platforms. The
841846
/// return value is a result indicating whether the new value was written and containing the
842847
/// previous value.
843848
///
844-
/// `compare_exchange_weak()` takes two [`Ordering`] arguments to describe the memory
849+
/// `compare_exchange_weak` takes two [`Ordering`] arguments to describe the memory
845850
/// ordering of this operation. The first describes the required ordering if the operation
846851
/// succeeds while the second describes the required ordering when the operation fails. The
847852
/// failure ordering can't be [`Release`] or [`AcqRel`] and must be equivalent or
848853
/// weaker than the success ordering.
849854
///
850-
/// [`compare_exchange()`]: #method.compare_exchange
855+
/// [`compare_exchange`]: #method.compare_exchange
851856
/// [`Ordering`]: enum.Ordering.html
852857
/// [`Release`]: enum.Ordering.html#variant.Release
853858
/// [`AcqRel`]: enum.Ordering.html#variant.AcqRel
@@ -986,7 +991,7 @@ macro_rules! atomic_int {
986991

987992
/// Loads a value from the atomic integer.
988993
///
989-
/// `load()` takes an [`Ordering`] argument which describes the memory ordering of this
994+
/// `load` takes an [`Ordering`] argument which describes the memory ordering of this
990995
/// operation.
991996
///
992997
/// # Panics
@@ -1014,7 +1019,7 @@ macro_rules! atomic_int {
10141019

10151020
/// Stores a value into the atomic integer.
10161021
///
1017-
/// `store()` takes an [`Ordering`] argument which describes the memory ordering of this
1022+
/// `store` takes an [`Ordering`] argument which describes the memory ordering of this
10181023
/// operation.
10191024
///
10201025
/// [`Ordering`]: enum.Ordering.html
@@ -1036,7 +1041,6 @@ macro_rules! atomic_int {
10361041
///
10371042
/// [`Acquire`]: enum.Ordering.html#variant.Acquire
10381043
/// [`AcqRel`]: enum.Ordering.html#variant.AcqRel
1039-
///
10401044
#[inline]
10411045
#[$stable]
10421046
pub fn store(&self, val: $int_type, order: Ordering) {
@@ -1045,7 +1049,7 @@ macro_rules! atomic_int {
10451049

10461050
/// Stores a value into the atomic integer, returning the old value.
10471051
///
1048-
/// `swap()` takes an [`Ordering`] argument which describes the memory ordering of this
1052+
/// `swap` takes an [`Ordering`] argument which describes the memory ordering of this
10491053
/// operation.
10501054
///
10511055
/// [`Ordering`]: enum.Ordering.html
@@ -1071,7 +1075,7 @@ macro_rules! atomic_int {
10711075
/// The return value is always the previous value. If it is equal to `current`, then the
10721076
/// value was updated.
10731077
///
1074-
/// `compare_and_swap()` also takes an [`Ordering`] argument which describes the memory
1078+
/// `compare_and_swap` also takes an [`Ordering`] argument which describes the memory
10751079
/// ordering of this operation.
10761080
///
10771081
/// [`Ordering`]: enum.Ordering.html
@@ -1111,7 +1115,7 @@ macro_rules! atomic_int {
11111115
/// containing the previous value. On success this value is guaranteed to be equal to
11121116
/// `current`.
11131117
///
1114-
/// `compare_exchange()` takes two [`Ordering`] arguments to describe the memory
1118+
/// `compare_exchange` takes two [`Ordering`] arguments to describe the memory
11151119
/// ordering of this operation. The first describes the required ordering if
11161120
/// the operation succeeds while the second describes the required ordering when
11171121
/// the operation fails. The failure ordering can't be [`Release`] or [`AcqRel`] and
@@ -1153,18 +1157,18 @@ macro_rules! atomic_int {
11531157
/// Stores a value into the atomic integer if the current value is the same as the
11541158
/// `current` value.
11551159
///
1156-
/// Unlike [`compare_exchange()`], this function is allowed to spuriously fail even
1160+
/// Unlike [`compare_exchange`], this function is allowed to spuriously fail even
11571161
/// when the comparison succeeds, which can result in more efficient code on some
11581162
/// platforms. The return value is a result indicating whether the new value was
11591163
/// written and containing the previous value.
11601164
///
1161-
/// `compare_exchange_weak()` takes two [`Ordering`] arguments to describe the memory
1165+
/// `compare_exchange_weak` takes two [`Ordering`] arguments to describe the memory
11621166
/// ordering of this operation. The first describes the required ordering if the
11631167
/// operation succeeds while the second describes the required ordering when the
11641168
/// operation fails. The failure ordering can't be [`Release`] or [`AcqRel`] and
11651169
/// must be equivalent or weaker than the success ordering.
11661170
///
1167-
/// [`compare_exchange()`]: #method.compare_exchange
1171+
/// [`compare_exchange`]: #method.compare_exchange
11681172
/// [`Ordering`]: enum.Ordering.html
11691173
/// [`Release`]: enum.Ordering.html#variant.Release
11701174
/// [`AcqRel`]: enum.Ordering.html#variant.AcqRel

0 commit comments

Comments
 (0)