@@ -162,6 +162,7 @@ unsafe impl Sync for AtomicBool {}
162
162
/// loads and stores of pointers. Its size depends on the target pointer's size.
163
163
#[ cfg( target_has_atomic_load_store = "ptr" ) ]
164
164
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
165
+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "AtomicPtr" ) ]
165
166
#[ cfg_attr( target_pointer_width = "16" , repr( C , align( 2 ) ) ) ]
166
167
#[ cfg_attr( target_pointer_width = "32" , repr( C , align( 4 ) ) ) ]
167
168
#[ cfg_attr( target_pointer_width = "64" , repr( C , align( 8 ) ) ) ]
@@ -1458,6 +1459,7 @@ macro_rules! atomic_int {
1458
1459
$stable_nand: meta,
1459
1460
$const_stable: meta,
1460
1461
$stable_init_const: meta,
1462
+ $diagnostic_item: meta,
1461
1463
$s_int_type: literal,
1462
1464
$extra_feature: expr,
1463
1465
$min_fn: ident, $max_fn: ident,
@@ -1480,6 +1482,7 @@ macro_rules! atomic_int {
1480
1482
///
1481
1483
/// [module-level documentation]: crate::sync::atomic
1482
1484
#[ $stable]
1485
+ #[ $diagnostic_item]
1483
1486
#[ repr( C , align( $align) ) ]
1484
1487
pub struct $atomic_type {
1485
1488
v: UnsafeCell <$int_type>,
@@ -2306,6 +2309,7 @@ atomic_int! {
2306
2309
stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
2307
2310
rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
2308
2311
unstable( feature = "integer_atomics" , issue = "32976" ) ,
2312
+ cfg_attr( not( test) , rustc_diagnostic_item = "AtomicI8" ) ,
2309
2313
"i8" ,
2310
2314
"" ,
2311
2315
atomic_min, atomic_max,
@@ -2325,6 +2329,7 @@ atomic_int! {
2325
2329
stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
2326
2330
rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
2327
2331
unstable( feature = "integer_atomics" , issue = "32976" ) ,
2332
+ cfg_attr( not( test) , rustc_diagnostic_item = "AtomicU8" ) ,
2328
2333
"u8" ,
2329
2334
"" ,
2330
2335
atomic_umin, atomic_umax,
@@ -2344,6 +2349,7 @@ atomic_int! {
2344
2349
stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
2345
2350
rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
2346
2351
unstable( feature = "integer_atomics" , issue = "32976" ) ,
2352
+ cfg_attr( not( test) , rustc_diagnostic_item = "AtomicI16" ) ,
2347
2353
"i16" ,
2348
2354
"" ,
2349
2355
atomic_min, atomic_max,
@@ -2363,6 +2369,7 @@ atomic_int! {
2363
2369
stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
2364
2370
rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
2365
2371
unstable( feature = "integer_atomics" , issue = "32976" ) ,
2372
+ cfg_attr( not( test) , rustc_diagnostic_item = "AtomicU16" ) ,
2366
2373
"u16" ,
2367
2374
"" ,
2368
2375
atomic_umin, atomic_umax,
@@ -2382,6 +2389,7 @@ atomic_int! {
2382
2389
stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
2383
2390
rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
2384
2391
unstable( feature = "integer_atomics" , issue = "32976" ) ,
2392
+ cfg_attr( not( test) , rustc_diagnostic_item = "AtomicI32" ) ,
2385
2393
"i32" ,
2386
2394
"" ,
2387
2395
atomic_min, atomic_max,
@@ -2401,6 +2409,7 @@ atomic_int! {
2401
2409
stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
2402
2410
rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
2403
2411
unstable( feature = "integer_atomics" , issue = "32976" ) ,
2412
+ cfg_attr( not( test) , rustc_diagnostic_item = "AtomicU32" ) ,
2404
2413
"u32" ,
2405
2414
"" ,
2406
2415
atomic_umin, atomic_umax,
@@ -2420,6 +2429,7 @@ atomic_int! {
2420
2429
stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
2421
2430
rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
2422
2431
unstable( feature = "integer_atomics" , issue = "32976" ) ,
2432
+ cfg_attr( not( test) , rustc_diagnostic_item = "AtomicI64" ) ,
2423
2433
"i64" ,
2424
2434
"" ,
2425
2435
atomic_min, atomic_max,
@@ -2439,6 +2449,7 @@ atomic_int! {
2439
2449
stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
2440
2450
rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
2441
2451
unstable( feature = "integer_atomics" , issue = "32976" ) ,
2452
+ cfg_attr( not( test) , rustc_diagnostic_item = "AtomicU64" ) ,
2442
2453
"u64" ,
2443
2454
"" ,
2444
2455
atomic_umin, atomic_umax,
@@ -2458,6 +2469,7 @@ atomic_int! {
2458
2469
unstable( feature = "integer_atomics" , issue = "32976" ) ,
2459
2470
rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
2460
2471
unstable( feature = "integer_atomics" , issue = "32976" ) ,
2472
+ cfg_attr( not( test) , rustc_diagnostic_item = "AtomicI128" ) ,
2461
2473
"i128" ,
2462
2474
"#![feature(integer_atomics)]\n \n " ,
2463
2475
atomic_min, atomic_max,
@@ -2477,6 +2489,7 @@ atomic_int! {
2477
2489
unstable( feature = "integer_atomics" , issue = "32976" ) ,
2478
2490
rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
2479
2491
unstable( feature = "integer_atomics" , issue = "32976" ) ,
2492
+ cfg_attr( not( test) , rustc_diagnostic_item = "AtomicU128" ) ,
2480
2493
"u128" ,
2481
2494
"#![feature(integer_atomics)]\n \n " ,
2482
2495
atomic_umin, atomic_umax,
@@ -2500,6 +2513,7 @@ macro_rules! atomic_int_ptr_sized {
2500
2513
stable( feature = "atomic_nand" , since = "1.27.0" ) ,
2501
2514
rustc_const_stable( feature = "const_ptr_sized_atomics" , since = "1.24.0" ) ,
2502
2515
stable( feature = "rust1" , since = "1.0.0" ) ,
2516
+ cfg_attr( not( test) , rustc_diagnostic_item = "AtomicIsize" ) ,
2503
2517
"isize" ,
2504
2518
"" ,
2505
2519
atomic_min, atomic_max,
@@ -2520,6 +2534,7 @@ macro_rules! atomic_int_ptr_sized {
2520
2534
stable( feature = "atomic_nand" , since = "1.27.0" ) ,
2521
2535
rustc_const_stable( feature = "const_ptr_sized_atomics" , since = "1.24.0" ) ,
2522
2536
stable( feature = "rust1" , since = "1.0.0" ) ,
2537
+ cfg_attr( not( test) , rustc_diagnostic_item = "AtomicUsize" ) ,
2523
2538
"usize" ,
2524
2539
"" ,
2525
2540
atomic_umin, atomic_umax,
0 commit comments