@@ -926,10 +926,24 @@ macro_rules! atomic_int {
926
926
$stable_cxchg: meta,
927
927
$stable_debug: meta,
928
928
$stable_access: meta,
929
+ $s_int_type: expr, $int_ref: expr,
929
930
$int_type: ident $atomic_type: ident $atomic_init: ident) => {
930
931
/// An integer type which can be safely shared between threads.
931
932
///
932
- /// This type has the same in-memory representation as the underlying integer type.
933
+ /// This type has the same in-memory representation as the underlying
934
+ /// integer type, [`
935
+ #[ doc = $s_int_type]
936
+ /// `](
937
+ #[ doc = $int_ref]
938
+ /// ). For more about the differences between atomic types and
939
+ /// non-atomic types, please see the [module-level documentation].
940
+ ///
941
+ /// Please note that examples are shared between atomic variants of
942
+ /// primitive integer types, so it's normal that they are all
943
+ /// demonstrating [`AtomicIsize`].
944
+ ///
945
+ /// [module-level documentation]: index.html
946
+ /// [`AtomicIsize`]: struct.AtomicIsize.html
933
947
#[ $stable]
934
948
pub struct $atomic_type {
935
949
v: UnsafeCell <$int_type>,
@@ -1339,6 +1353,7 @@ atomic_int! {
1339
1353
unstable( feature = "integer_atomics" , issue = "32976" ) ,
1340
1354
unstable( feature = "integer_atomics" , issue = "32976" ) ,
1341
1355
unstable( feature = "integer_atomics" , issue = "32976" ) ,
1356
+ "i8" , "../../../std/primitive.i8.html" ,
1342
1357
i8 AtomicI8 ATOMIC_I8_INIT
1343
1358
}
1344
1359
#[ cfg( target_has_atomic = "8" ) ]
@@ -1348,6 +1363,7 @@ atomic_int! {
1348
1363
unstable( feature = "integer_atomics" , issue = "32976" ) ,
1349
1364
unstable( feature = "integer_atomics" , issue = "32976" ) ,
1350
1365
unstable( feature = "integer_atomics" , issue = "32976" ) ,
1366
+ "u8" , "../../../std/primitive.u8.html" ,
1351
1367
u8 AtomicU8 ATOMIC_U8_INIT
1352
1368
}
1353
1369
#[ cfg( target_has_atomic = "16" ) ]
@@ -1357,6 +1373,7 @@ atomic_int! {
1357
1373
unstable( feature = "integer_atomics" , issue = "32976" ) ,
1358
1374
unstable( feature = "integer_atomics" , issue = "32976" ) ,
1359
1375
unstable( feature = "integer_atomics" , issue = "32976" ) ,
1376
+ "i16" , "../../../std/primitive.i16.html" ,
1360
1377
i16 AtomicI16 ATOMIC_I16_INIT
1361
1378
}
1362
1379
#[ cfg( target_has_atomic = "16" ) ]
@@ -1366,6 +1383,7 @@ atomic_int! {
1366
1383
unstable( feature = "integer_atomics" , issue = "32976" ) ,
1367
1384
unstable( feature = "integer_atomics" , issue = "32976" ) ,
1368
1385
unstable( feature = "integer_atomics" , issue = "32976" ) ,
1386
+ "u16" , "../../../std/primitive.u16.html" ,
1369
1387
u16 AtomicU16 ATOMIC_U16_INIT
1370
1388
}
1371
1389
#[ cfg( target_has_atomic = "32" ) ]
@@ -1375,6 +1393,7 @@ atomic_int! {
1375
1393
unstable( feature = "integer_atomics" , issue = "32976" ) ,
1376
1394
unstable( feature = "integer_atomics" , issue = "32976" ) ,
1377
1395
unstable( feature = "integer_atomics" , issue = "32976" ) ,
1396
+ "i32" , "../../../std/primitive.i32.html" ,
1378
1397
i32 AtomicI32 ATOMIC_I32_INIT
1379
1398
}
1380
1399
#[ cfg( target_has_atomic = "32" ) ]
@@ -1384,6 +1403,7 @@ atomic_int! {
1384
1403
unstable( feature = "integer_atomics" , issue = "32976" ) ,
1385
1404
unstable( feature = "integer_atomics" , issue = "32976" ) ,
1386
1405
unstable( feature = "integer_atomics" , issue = "32976" ) ,
1406
+ "u32" , "../../../std/primitive.u32.html" ,
1387
1407
u32 AtomicU32 ATOMIC_U32_INIT
1388
1408
}
1389
1409
#[ cfg( target_has_atomic = "64" ) ]
@@ -1393,6 +1413,7 @@ atomic_int! {
1393
1413
unstable( feature = "integer_atomics" , issue = "32976" ) ,
1394
1414
unstable( feature = "integer_atomics" , issue = "32976" ) ,
1395
1415
unstable( feature = "integer_atomics" , issue = "32976" ) ,
1416
+ "i64" , "../../../std/primitive.i64.html" ,
1396
1417
i64 AtomicI64 ATOMIC_I64_INIT
1397
1418
}
1398
1419
#[ cfg( target_has_atomic = "64" ) ]
@@ -1402,6 +1423,7 @@ atomic_int! {
1402
1423
unstable( feature = "integer_atomics" , issue = "32976" ) ,
1403
1424
unstable( feature = "integer_atomics" , issue = "32976" ) ,
1404
1425
unstable( feature = "integer_atomics" , issue = "32976" ) ,
1426
+ "u64" , "../../../std/primitive.u64.html" ,
1405
1427
u64 AtomicU64 ATOMIC_U64_INIT
1406
1428
}
1407
1429
#[ cfg( target_has_atomic = "ptr" ) ]
@@ -1411,6 +1433,7 @@ atomic_int!{
1411
1433
stable( feature = "extended_compare_and_swap" , since = "1.10.0" ) ,
1412
1434
stable( feature = "atomic_debug" , since = "1.3.0" ) ,
1413
1435
stable( feature = "atomic_access" , since = "1.15.0" ) ,
1436
+ "isize" , "../../../std/primitive.isize.html" ,
1414
1437
isize AtomicIsize ATOMIC_ISIZE_INIT
1415
1438
}
1416
1439
#[ cfg( target_has_atomic = "ptr" ) ]
@@ -1420,6 +1443,7 @@ atomic_int!{
1420
1443
stable( feature = "extended_compare_and_swap" , since = "1.10.0" ) ,
1421
1444
stable( feature = "atomic_debug" , since = "1.3.0" ) ,
1422
1445
stable( feature = "atomic_access" , since = "1.15.0" ) ,
1446
+ "usize" , "../../../std/primitive.usize.html" ,
1423
1447
usize AtomicUsize ATOMIC_USIZE_INIT
1424
1448
}
1425
1449
0 commit comments