@@ -153,6 +153,9 @@ pub fn spin_loop_hint() {
153
153
///
154
154
/// This type has the same in-memory representation as a [`bool`].
155
155
///
156
+ /// **Note**: This type is only available on platforms that support atomic
157
+ /// loads and stores of `u8`.
158
+ ///
156
159
/// [`bool`]: ../../../std/primitive.bool.html
157
160
#[ cfg( target_has_atomic_load_store = "8" ) ]
158
161
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -178,6 +181,9 @@ unsafe impl Sync for AtomicBool {}
178
181
/// A raw pointer type which can be safely shared between threads.
179
182
///
180
183
/// This type has the same in-memory representation as a `*mut T`.
184
+ ///
185
+ /// **Note**: This type is only available on platforms that support atomic
186
+ /// loads and stores of pointers. Its size depends on the target pointer's size.
181
187
#[ cfg( target_has_atomic_load_store = "ptr" ) ]
182
188
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
183
189
#[ cfg_attr( target_pointer_width = "16" , repr( C , align( 2 ) ) ) ]
@@ -447,6 +453,9 @@ impl AtomicBool {
447
453
/// [`Acquire`] makes the store part of this operation [`Relaxed`], and
448
454
/// using [`Release`] makes the load part [`Relaxed`].
449
455
///
456
+ /// **Note:** This method is only available on platforms that support atomic
457
+ /// operations on `u8`.
458
+ ///
450
459
/// [`Ordering`]: enum.Ordering.html
451
460
/// [`Relaxed`]: enum.Ordering.html#variant.Relaxed
452
461
/// [`Release`]: enum.Ordering.html#variant.Release
@@ -481,6 +490,9 @@ impl AtomicBool {
481
490
/// Using [`Acquire`] makes the store part of this operation [`Relaxed`] if it
482
491
/// happens, and using [`Release`] makes the load part [`Relaxed`].
483
492
///
493
+ /// **Note:** This method is only available on platforms that support atomic
494
+ /// operations on `u8`.
495
+ ///
484
496
/// [`Ordering`]: enum.Ordering.html
485
497
/// [`Relaxed`]: enum.Ordering.html#variant.Relaxed
486
498
/// [`Release`]: enum.Ordering.html#variant.Release
@@ -524,6 +536,8 @@ impl AtomicBool {
524
536
/// [`Relaxed`]. The failure ordering can only be [`SeqCst`], [`Acquire`] or [`Relaxed`]
525
537
/// and must be equivalent to or weaker than the success ordering.
526
538
///
539
+ /// **Note:** This method is only available on platforms that support atomic
540
+ /// operations on `u8`.
527
541
///
528
542
/// [`bool`]: ../../../std/primitive.bool.html
529
543
/// [`Ordering`]: enum.Ordering.html
@@ -586,6 +600,9 @@ impl AtomicBool {
586
600
/// [`Relaxed`]. The failure ordering can only be [`SeqCst`], [`Acquire`] or [`Relaxed`]
587
601
/// and must be equivalent to or weaker than the success ordering.
588
602
///
603
+ /// **Note:** This method is only available on platforms that support atomic
604
+ /// operations on `u8`.
605
+ ///
589
606
/// [`bool`]: ../../../std/primitive.bool.html
590
607
/// [`compare_exchange`]: #method.compare_exchange
591
608
/// [`Ordering`]: enum.Ordering.html
@@ -646,6 +663,9 @@ impl AtomicBool {
646
663
/// [`Release`]: enum.Ordering.html#variant.Release
647
664
/// [`Acquire`]: enum.Ordering.html#variant.Acquire
648
665
///
666
+ /// **Note:** This method is only available on platforms that support atomic
667
+ /// operations on `u8`.
668
+ ///
649
669
/// # Examples
650
670
///
651
671
/// ```
@@ -683,6 +703,9 @@ impl AtomicBool {
683
703
/// [`Acquire`] makes the store part of this operation [`Relaxed`], and
684
704
/// using [`Release`] makes the load part [`Relaxed`].
685
705
///
706
+ /// **Note:** This method is only available on platforms that support atomic
707
+ /// operations on `u8`.
708
+ ///
686
709
/// [`Ordering`]: enum.Ordering.html
687
710
/// [`Relaxed`]: enum.Ordering.html#variant.Relaxed
688
711
/// [`Release`]: enum.Ordering.html#variant.Release
@@ -737,6 +760,9 @@ impl AtomicBool {
737
760
/// [`Acquire`] makes the store part of this operation [`Relaxed`], and
738
761
/// using [`Release`] makes the load part [`Relaxed`].
739
762
///
763
+ /// **Note:** This method is only available on platforms that support atomic
764
+ /// operations on `u8`.
765
+ ///
740
766
/// [`Ordering`]: enum.Ordering.html
741
767
/// [`Relaxed`]: enum.Ordering.html#variant.Relaxed
742
768
/// [`Release`]: enum.Ordering.html#variant.Release
@@ -779,6 +805,9 @@ impl AtomicBool {
779
805
/// [`Acquire`] makes the store part of this operation [`Relaxed`], and
780
806
/// using [`Release`] makes the load part [`Relaxed`].
781
807
///
808
+ /// **Note:** This method is only available on platforms that support atomic
809
+ /// operations on `u8`.
810
+ ///
782
811
/// [`Ordering`]: enum.Ordering.html
783
812
/// [`Relaxed`]: enum.Ordering.html#variant.Relaxed
784
813
/// [`Release`]: enum.Ordering.html#variant.Release
@@ -981,6 +1010,9 @@ impl<T> AtomicPtr<T> {
981
1010
/// [`Acquire`] makes the store part of this operation [`Relaxed`], and
982
1011
/// using [`Release`] makes the load part [`Relaxed`].
983
1012
///
1013
+ /// **Note:** This method is only available on platforms that support atomic
1014
+ /// operations on pointers.
1015
+ ///
984
1016
/// [`Ordering`]: enum.Ordering.html
985
1017
/// [`Relaxed`]: enum.Ordering.html#variant.Relaxed
986
1018
/// [`Release`]: enum.Ordering.html#variant.Release
@@ -1017,6 +1049,9 @@ impl<T> AtomicPtr<T> {
1017
1049
/// Using [`Acquire`] makes the store part of this operation [`Relaxed`] if it
1018
1050
/// happens, and using [`Release`] makes the load part [`Relaxed`].
1019
1051
///
1052
+ /// **Note:** This method is only available on platforms that support atomic
1053
+ /// operations on pointers.
1054
+ ///
1020
1055
/// [`Ordering`]: enum.Ordering.html
1021
1056
/// [`Relaxed`]: enum.Ordering.html#variant.Relaxed
1022
1057
/// [`Release`]: enum.Ordering.html#variant.Release
@@ -1058,6 +1093,9 @@ impl<T> AtomicPtr<T> {
1058
1093
/// [`Relaxed`]. The failure ordering can only be [`SeqCst`], [`Acquire`] or [`Relaxed`]
1059
1094
/// and must be equivalent to or weaker than the success ordering.
1060
1095
///
1096
+ /// **Note:** This method is only available on platforms that support atomic
1097
+ /// operations on pointers.
1098
+ ///
1061
1099
/// [`Ordering`]: enum.Ordering.html
1062
1100
/// [`Relaxed`]: enum.Ordering.html#variant.Relaxed
1063
1101
/// [`Release`]: enum.Ordering.html#variant.Release
@@ -1118,6 +1156,9 @@ impl<T> AtomicPtr<T> {
1118
1156
/// [`Relaxed`]. The failure ordering can only be [`SeqCst`], [`Acquire`] or [`Relaxed`]
1119
1157
/// and must be equivalent to or weaker than the success ordering.
1120
1158
///
1159
+ /// **Note:** This method is only available on platforms that support atomic
1160
+ /// operations on pointers.
1161
+ ///
1121
1162
/// [`compare_exchange`]: #method.compare_exchange
1122
1163
/// [`Ordering`]: enum.Ordering.html
1123
1164
/// [`Relaxed`]: enum.Ordering.html#variant.Relaxed
@@ -1223,6 +1264,13 @@ macro_rules! atomic_int {
1223
1264
/// non-atomic types as well as information about the portability of
1224
1265
/// this type, please see the [module-level documentation].
1225
1266
///
1267
+ /// **Note:** This type is only available on platforms that support
1268
+ /// atomic loads and stores of [`
1269
+ #[ doc = $s_int_type]
1270
+ /// `](
1271
+ #[ doc = $int_ref]
1272
+ /// ).
1273
+ ///
1226
1274
/// [module-level documentation]: index.html
1227
1275
#[ $stable]
1228
1276
#[ repr( C , align( $align) ) ]
@@ -1408,6 +1456,9 @@ of this operation. All ordering modes are possible. Note that using
1408
1456
[`Acquire`] makes the store part of this operation [`Relaxed`], and
1409
1457
using [`Release`] makes the load part [`Relaxed`].
1410
1458
1459
+ **Note**: This method is only available on platforms that support atomic
1460
+ operations on [`" , $s_int_type, "`](" , $int_ref, ").
1461
+
1411
1462
[`Ordering`]: enum.Ordering.html
1412
1463
[`Relaxed`]: enum.Ordering.html#variant.Relaxed
1413
1464
[`Release`]: enum.Ordering.html#variant.Release
@@ -1444,6 +1495,9 @@ might fail and hence just perform an `Acquire` load, but not have `Release` sema
1444
1495
Using [`Acquire`] makes the store part of this operation [`Relaxed`] if it
1445
1496
happens, and using [`Release`] makes the load part [`Relaxed`].
1446
1497
1498
+ **Note**: This method is only available on platforms that support atomic
1499
+ operations on [`" , $s_int_type, "`](" , $int_ref, ").
1500
+
1447
1501
[`Ordering`]: enum.Ordering.html
1448
1502
[`Relaxed`]: enum.Ordering.html#variant.Relaxed
1449
1503
[`Release`]: enum.Ordering.html#variant.Release
@@ -1496,6 +1550,9 @@ of this operation [`Relaxed`], and using [`Release`] makes the successful load
1496
1550
[`Relaxed`]. The failure ordering can only be [`SeqCst`], [`Acquire`] or [`Relaxed`]
1497
1551
and must be equivalent to or weaker than the success ordering.
1498
1552
1553
+ **Note**: This method is only available on platforms that support atomic
1554
+ operations on [`" , $s_int_type, "`](" , $int_ref, ").
1555
+
1499
1556
[`Ordering`]: enum.Ordering.html
1500
1557
[`Relaxed`]: enum.Ordering.html#variant.Relaxed
1501
1558
[`Release`]: enum.Ordering.html#variant.Release
@@ -1558,6 +1615,9 @@ and must be equivalent to or weaker than the success ordering.
1558
1615
[`Acquire`]: enum.Ordering.html#variant.Acquire
1559
1616
[`SeqCst`]: enum.Ordering.html#variant.SeqCst
1560
1617
1618
+ **Note**: This method is only available on platforms that support atomic
1619
+ operations on [`" , $s_int_type, "`](" , $int_ref, ").
1620
+
1561
1621
# Examples
1562
1622
1563
1623
```
@@ -1599,6 +1659,9 @@ of this operation. All ordering modes are possible. Note that using
1599
1659
[`Acquire`] makes the store part of this operation [`Relaxed`], and
1600
1660
using [`Release`] makes the load part [`Relaxed`].
1601
1661
1662
+ **Note**: This method is only available on platforms that support atomic
1663
+ operations on [`" , $s_int_type, "`](" , $int_ref, ").
1664
+
1602
1665
[`Ordering`]: enum.Ordering.html
1603
1666
[`Relaxed`]: enum.Ordering.html#variant.Relaxed
1604
1667
[`Release`]: enum.Ordering.html#variant.Release
@@ -1632,6 +1695,9 @@ of this operation. All ordering modes are possible. Note that using
1632
1695
[`Acquire`] makes the store part of this operation [`Relaxed`], and
1633
1696
using [`Release`] makes the load part [`Relaxed`].
1634
1697
1698
+ **Note**: This method is only available on platforms that support atomic
1699
+ operations on [`" , $s_int_type, "`](" , $int_ref, ").
1700
+
1635
1701
[`Ordering`]: enum.Ordering.html
1636
1702
[`Relaxed`]: enum.Ordering.html#variant.Relaxed
1637
1703
[`Release`]: enum.Ordering.html#variant.Release
@@ -1668,6 +1734,9 @@ of this operation. All ordering modes are possible. Note that using
1668
1734
[`Acquire`] makes the store part of this operation [`Relaxed`], and
1669
1735
using [`Release`] makes the load part [`Relaxed`].
1670
1736
1737
+ **Note**: This method is only available on platforms that support atomic
1738
+ operations on [`" , $s_int_type, "`](" , $int_ref, ").
1739
+
1671
1740
[`Ordering`]: enum.Ordering.html
1672
1741
[`Relaxed`]: enum.Ordering.html#variant.Relaxed
1673
1742
[`Release`]: enum.Ordering.html#variant.Release
@@ -1704,6 +1773,9 @@ of this operation. All ordering modes are possible. Note that using
1704
1773
[`Acquire`] makes the store part of this operation [`Relaxed`], and
1705
1774
using [`Release`] makes the load part [`Relaxed`].
1706
1775
1776
+ **Note**: This method is only available on platforms that support atomic
1777
+ operations on [`" , $s_int_type, "`](" , $int_ref, ").
1778
+
1707
1779
[`Ordering`]: enum.Ordering.html
1708
1780
[`Relaxed`]: enum.Ordering.html#variant.Relaxed
1709
1781
[`Release`]: enum.Ordering.html#variant.Release
@@ -1741,6 +1813,9 @@ of this operation. All ordering modes are possible. Note that using
1741
1813
[`Acquire`] makes the store part of this operation [`Relaxed`], and
1742
1814
using [`Release`] makes the load part [`Relaxed`].
1743
1815
1816
+ **Note**: This method is only available on platforms that support atomic
1817
+ operations on [`" , $s_int_type, "`](" , $int_ref, ").
1818
+
1744
1819
[`Ordering`]: enum.Ordering.html
1745
1820
[`Relaxed`]: enum.Ordering.html#variant.Relaxed
1746
1821
[`Release`]: enum.Ordering.html#variant.Release
@@ -1777,6 +1852,9 @@ of this operation. All ordering modes are possible. Note that using
1777
1852
[`Acquire`] makes the store part of this operation [`Relaxed`], and
1778
1853
using [`Release`] makes the load part [`Relaxed`].
1779
1854
1855
+ **Note**: This method is only available on platforms that support atomic
1856
+ operations on [`" , $s_int_type, "`](" , $int_ref, ").
1857
+
1780
1858
[`Ordering`]: enum.Ordering.html
1781
1859
[`Relaxed`]: enum.Ordering.html#variant.Relaxed
1782
1860
[`Release`]: enum.Ordering.html#variant.Release
@@ -1819,6 +1897,9 @@ of this operation [`Relaxed`], and using [`Release`] makes the final successful
1819
1897
[`Relaxed`]. The (failed) load ordering can only be [`SeqCst`], [`Acquire`] or [`Relaxed`]
1820
1898
and must be equivalent to or weaker than the success ordering.
1821
1899
1900
+ **Note**: This method is only available on platforms that support atomic
1901
+ operations on [`" , $s_int_type, "`](" , $int_ref, ").
1902
+
1822
1903
[`bool`]: ../../../std/primitive.bool.html
1823
1904
[`compare_exchange`]: #method.compare_exchange
1824
1905
[`Ordering`]: enum.Ordering.html
@@ -1870,6 +1951,9 @@ of this operation. All ordering modes are possible. Note that using
1870
1951
[`Acquire`] makes the store part of this operation [`Relaxed`], and
1871
1952
using [`Release`] makes the load part [`Relaxed`].
1872
1953
1954
+ **Note**: This method is only available on platforms that support atomic
1955
+ operations on [`" , $s_int_type, "`](" , $int_ref, ").
1956
+
1873
1957
[`Ordering`]: enum.Ordering.html
1874
1958
[`Relaxed`]: enum.Ordering.html#variant.Relaxed
1875
1959
[`Release`]: enum.Ordering.html#variant.Release
@@ -1917,6 +2001,9 @@ of this operation. All ordering modes are possible. Note that using
1917
2001
[`Acquire`] makes the store part of this operation [`Relaxed`], and
1918
2002
using [`Release`] makes the load part [`Relaxed`].
1919
2003
2004
+ **Note**: This method is only available on platforms that support atomic
2005
+ operations on [`" , $s_int_type, "`](" , $int_ref, ").
2006
+
1920
2007
[`Ordering`]: enum.Ordering.html
1921
2008
[`Relaxed`]: enum.Ordering.html#variant.Relaxed
1922
2009
[`Release`]: enum.Ordering.html#variant.Release
0 commit comments