@@ -153,6 +153,8 @@ 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 may not be available on some platforms.
157
+ ///
156
158
/// [`bool`]: ../../../std/primitive.bool.html
157
159
#[ cfg( target_has_atomic_load_store = "8" ) ]
158
160
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -178,6 +180,9 @@ unsafe impl Sync for AtomicBool {}
178
180
/// A raw pointer type which can be safely shared between threads.
179
181
///
180
182
/// This type has the same in-memory representation as a `*mut T`.
183
+ ///
184
+ /// **Note**: This type may not be available on some platforms. Its size depends
185
+ /// on the target pointer's size.
181
186
#[ cfg( target_has_atomic_load_store = "ptr" ) ]
182
187
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
183
188
#[ cfg_attr( target_pointer_width = "16" , repr( C , align( 2 ) ) ) ]
@@ -462,6 +467,8 @@ impl AtomicBool {
462
467
/// assert_eq!(some_bool.swap(false, Ordering::Relaxed), true);
463
468
/// assert_eq!(some_bool.load(Ordering::Relaxed), false);
464
469
/// ```
470
+ ///
471
+ /// **Note**: This method may not be available on some platforms.
465
472
#[ inline]
466
473
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
467
474
#[ cfg( target_has_atomic = "8" ) ]
@@ -501,6 +508,8 @@ impl AtomicBool {
501
508
/// assert_eq!(some_bool.compare_and_swap(true, true, Ordering::Relaxed), false);
502
509
/// assert_eq!(some_bool.load(Ordering::Relaxed), false);
503
510
/// ```
511
+ ///
512
+ /// **Note**: This method may not be available on some platforms.
504
513
#[ inline]
505
514
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
506
515
#[ cfg( target_has_atomic = "8" ) ]
@@ -552,6 +561,8 @@ impl AtomicBool {
552
561
/// Err(false));
553
562
/// assert_eq!(some_bool.load(Ordering::Relaxed), false);
554
563
/// ```
564
+ ///
565
+ /// **Note**: This method may not be available on some platforms.
555
566
#[ inline]
556
567
#[ stable( feature = "extended_compare_and_swap" , since = "1.10.0" ) ]
557
568
#[ cfg( target_has_atomic = "8" ) ]
@@ -610,6 +621,8 @@ impl AtomicBool {
610
621
/// }
611
622
/// }
612
623
/// ```
624
+ ///
625
+ /// **Note**: This method may not be available on some platforms.
613
626
#[ inline]
614
627
#[ stable( feature = "extended_compare_and_swap" , since = "1.10.0" ) ]
615
628
#[ cfg( target_has_atomic = "8" ) ]
@@ -663,6 +676,8 @@ impl AtomicBool {
663
676
/// assert_eq!(foo.fetch_and(false, Ordering::SeqCst), false);
664
677
/// assert_eq!(foo.load(Ordering::SeqCst), false);
665
678
/// ```
679
+ ///
680
+ /// **Note**: This method may not be available on some platforms.
666
681
#[ inline]
667
682
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
668
683
#[ cfg( target_has_atomic = "8" ) ]
@@ -706,6 +721,8 @@ impl AtomicBool {
706
721
/// assert_eq!(foo.fetch_nand(false, Ordering::SeqCst), false);
707
722
/// assert_eq!(foo.load(Ordering::SeqCst), true);
708
723
/// ```
724
+ ///
725
+ /// **Note**: This method may not be available on some platforms.
709
726
#[ inline]
710
727
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
711
728
#[ cfg( target_has_atomic = "8" ) ]
@@ -759,6 +776,8 @@ impl AtomicBool {
759
776
/// assert_eq!(foo.fetch_or(false, Ordering::SeqCst), false);
760
777
/// assert_eq!(foo.load(Ordering::SeqCst), false);
761
778
/// ```
779
+ ///
780
+ /// **Note**: This method may not be available on some platforms.
762
781
#[ inline]
763
782
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
764
783
#[ cfg( target_has_atomic = "8" ) ]
@@ -801,6 +820,8 @@ impl AtomicBool {
801
820
/// assert_eq!(foo.fetch_xor(false, Ordering::SeqCst), false);
802
821
/// assert_eq!(foo.load(Ordering::SeqCst), false);
803
822
/// ```
823
+ ///
824
+ /// **Note**: This method may not be available on some platforms.
804
825
#[ inline]
805
826
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
806
827
#[ cfg( target_has_atomic = "8" ) ]
@@ -998,6 +1019,8 @@ impl<T> AtomicPtr<T> {
998
1019
///
999
1020
/// let value = some_ptr.swap(other_ptr, Ordering::Relaxed);
1000
1021
/// ```
1022
+ ///
1023
+ /// **Note**: This method may not be available on some platforms.
1001
1024
#[ inline]
1002
1025
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1003
1026
#[ cfg( target_has_atomic = "ptr" ) ]
@@ -1035,6 +1058,8 @@ impl<T> AtomicPtr<T> {
1035
1058
///
1036
1059
/// let value = some_ptr.compare_and_swap(ptr, other_ptr, Ordering::Relaxed);
1037
1060
/// ```
1061
+ ///
1062
+ /// **Note**: This method may not be available on some platforms.
1038
1063
#[ inline]
1039
1064
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1040
1065
#[ cfg( target_has_atomic = "ptr" ) ]
@@ -1077,6 +1102,8 @@ impl<T> AtomicPtr<T> {
1077
1102
/// let value = some_ptr.compare_exchange(ptr, other_ptr,
1078
1103
/// Ordering::SeqCst, Ordering::Relaxed);
1079
1104
/// ```
1105
+ ///
1106
+ /// **Note**: This method may not be available on some platforms.
1080
1107
#[ inline]
1081
1108
#[ stable( feature = "extended_compare_and_swap" , since = "1.10.0" ) ]
1082
1109
#[ cfg( target_has_atomic = "ptr" ) ]
@@ -1141,6 +1168,8 @@ impl<T> AtomicPtr<T> {
1141
1168
/// }
1142
1169
/// }
1143
1170
/// ```
1171
+ ///
1172
+ /// **Note**: This method may not be available on some platforms.
1144
1173
#[ inline]
1145
1174
#[ stable( feature = "extended_compare_and_swap" , since = "1.10.0" ) ]
1146
1175
#[ cfg( target_has_atomic = "ptr" ) ]
@@ -1223,6 +1252,8 @@ macro_rules! atomic_int {
1223
1252
/// non-atomic types as well as information about the portability of
1224
1253
/// this type, please see the [module-level documentation].
1225
1254
///
1255
+ /// **Note**: This type may not be available on some platforms.
1256
+ ///
1226
1257
/// [module-level documentation]: index.html
1227
1258
#[ $stable]
1228
1259
#[ repr( C , align( $align) ) ]
@@ -1421,7 +1452,9 @@ using [`Release`] makes the load part [`Relaxed`].
1421
1452
let some_var = " , stringify!( $atomic_type) , "::new(5);
1422
1453
1423
1454
assert_eq!(some_var.swap(10, Ordering::Relaxed), 5);
1424
- ```" ) ,
1455
+ ```
1456
+
1457
+ **Note**: This method may not be available on some platforms." ) ,
1425
1458
#[ inline]
1426
1459
#[ $stable]
1427
1460
#[ $cfg_cas]
@@ -1462,7 +1495,9 @@ assert_eq!(some_var.load(Ordering::Relaxed), 10);
1462
1495
1463
1496
assert_eq!(some_var.compare_and_swap(6, 12, Ordering::Relaxed), 10);
1464
1497
assert_eq!(some_var.load(Ordering::Relaxed), 10);
1465
- ```" ) ,
1498
+ ```
1499
+
1500
+ **Note**: This method may not be available on some platforms." ) ,
1466
1501
#[ inline]
1467
1502
#[ $stable]
1468
1503
#[ $cfg_cas]
@@ -1520,7 +1555,9 @@ assert_eq!(some_var.compare_exchange(6, 12,
1520
1555
Ordering::Acquire),
1521
1556
Err(10));
1522
1557
assert_eq!(some_var.load(Ordering::Relaxed), 10);
1523
- ```" ) ,
1558
+ ```
1559
+
1560
+ **Note**: This method may not be available on some platforms." ) ,
1524
1561
#[ inline]
1525
1562
#[ $stable_cxchg]
1526
1563
#[ $cfg_cas]
@@ -1573,7 +1610,9 @@ loop {
1573
1610
Err(x) => old = x,
1574
1611
}
1575
1612
}
1576
- ```" ) ,
1613
+ ```
1614
+
1615
+ **Note**: This method may not be available on some platforms." ) ,
1577
1616
#[ inline]
1578
1617
#[ $stable_cxchg]
1579
1618
#[ $cfg_cas]
@@ -1612,7 +1651,9 @@ using [`Release`] makes the load part [`Relaxed`].
1612
1651
let foo = " , stringify!( $atomic_type) , "::new(0);
1613
1652
assert_eq!(foo.fetch_add(10, Ordering::SeqCst), 0);
1614
1653
assert_eq!(foo.load(Ordering::SeqCst), 10);
1615
- ```" ) ,
1654
+ ```
1655
+
1656
+ **Note**: This method may not be available on some platforms." ) ,
1616
1657
#[ inline]
1617
1658
#[ $stable]
1618
1659
#[ $cfg_cas]
@@ -1645,7 +1686,9 @@ using [`Release`] makes the load part [`Relaxed`].
1645
1686
let foo = " , stringify!( $atomic_type) , "::new(20);
1646
1687
assert_eq!(foo.fetch_sub(10, Ordering::SeqCst), 20);
1647
1688
assert_eq!(foo.load(Ordering::SeqCst), 10);
1648
- ```" ) ,
1689
+ ```
1690
+
1691
+ **Note**: This method may not be available on some platforms." ) ,
1649
1692
#[ inline]
1650
1693
#[ $stable]
1651
1694
#[ $cfg_cas]
@@ -1681,7 +1724,9 @@ using [`Release`] makes the load part [`Relaxed`].
1681
1724
let foo = " , stringify!( $atomic_type) , "::new(0b101101);
1682
1725
assert_eq!(foo.fetch_and(0b110011, Ordering::SeqCst), 0b101101);
1683
1726
assert_eq!(foo.load(Ordering::SeqCst), 0b100001);
1684
- ```" ) ,
1727
+ ```
1728
+
1729
+ **Note**: This method may not be available on some platforms." ) ,
1685
1730
#[ inline]
1686
1731
#[ $stable]
1687
1732
#[ $cfg_cas]
@@ -1718,7 +1763,9 @@ use std::sync::atomic::{", stringify!($atomic_type), ", Ordering};
1718
1763
let foo = " , stringify!( $atomic_type) , "::new(0x13);
1719
1764
assert_eq!(foo.fetch_nand(0x31, Ordering::SeqCst), 0x13);
1720
1765
assert_eq!(foo.load(Ordering::SeqCst), !(0x13 & 0x31));
1721
- ```" ) ,
1766
+ ```
1767
+
1768
+ **Note**: This method may not be available on some platforms." ) ,
1722
1769
#[ inline]
1723
1770
#[ $stable_nand]
1724
1771
#[ $cfg_cas]
@@ -1754,7 +1801,9 @@ using [`Release`] makes the load part [`Relaxed`].
1754
1801
let foo = " , stringify!( $atomic_type) , "::new(0b101101);
1755
1802
assert_eq!(foo.fetch_or(0b110011, Ordering::SeqCst), 0b101101);
1756
1803
assert_eq!(foo.load(Ordering::SeqCst), 0b111111);
1757
- ```" ) ,
1804
+ ```
1805
+
1806
+ **Note**: This method may not be available on some platforms." ) ,
1758
1807
#[ inline]
1759
1808
#[ $stable]
1760
1809
#[ $cfg_cas]
@@ -1790,7 +1839,9 @@ using [`Release`] makes the load part [`Relaxed`].
1790
1839
let foo = " , stringify!( $atomic_type) , "::new(0b101101);
1791
1840
assert_eq!(foo.fetch_xor(0b110011, Ordering::SeqCst), 0b101101);
1792
1841
assert_eq!(foo.load(Ordering::SeqCst), 0b011110);
1793
- ```" ) ,
1842
+ ```
1843
+
1844
+ **Note**: This method may not be available on some platforms." ) ,
1794
1845
#[ inline]
1795
1846
#[ $stable]
1796
1847
#[ $cfg_cas]
@@ -1837,7 +1888,9 @@ assert_eq!(x.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |_| None), Err(7))
1837
1888
assert_eq!(x.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |x| Some(x + 1)), Ok(7));
1838
1889
assert_eq!(x.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |x| Some(x + 1)), Ok(8));
1839
1890
assert_eq!(x.load(Ordering::SeqCst), 9);
1840
- ```" ) ,
1891
+ ```
1892
+
1893
+ **Note**: This method may not be available on some platforms." ) ,
1841
1894
#[ inline]
1842
1895
#[ stable( feature = "no_more_cas" , since = "1.45.0" ) ]
1843
1896
#[ $cfg_cas]
@@ -1894,7 +1947,9 @@ let foo = ", stringify!($atomic_type), "::new(23);
1894
1947
let bar = 42;
1895
1948
let max_foo = foo.fetch_max(bar, Ordering::SeqCst).max(bar);
1896
1949
assert!(max_foo == 42);
1897
- ```" ) ,
1950
+ ```
1951
+
1952
+ **Note**: This method may not be available on some platforms." ) ,
1898
1953
#[ inline]
1899
1954
#[ stable( feature = "atomic_min_max" , since = "1.45.0" ) ]
1900
1955
#[ $cfg_cas]
@@ -1943,7 +1998,9 @@ let foo = ", stringify!($atomic_type), "::new(23);
1943
1998
let bar = 12;
1944
1999
let min_foo = foo.fetch_min(bar, Ordering::SeqCst).min(bar);
1945
2000
assert_eq!(min_foo, 12);
1946
- ```" ) ,
2001
+ ```
2002
+
2003
+ **Note**: This method may not be available on some platforms." ) ,
1947
2004
#[ inline]
1948
2005
#[ stable( feature = "atomic_min_max" , since = "1.45.0" ) ]
1949
2006
#[ $cfg_cas]
0 commit comments