@@ -162,6 +162,7 @@ unsafe impl Sync for AtomicBool {}
162162/// loads and stores of pointers. Its size depends on the target pointer's size.
163163#[ cfg( target_has_atomic_load_store = "ptr" ) ]
164164#[ stable( feature = "rust1" , since = "1.0.0" ) ]
165+ #[ cfg_attr( not( test) , rustc_diagnostic_item = "AtomicPtr" ) ]
165166#[ cfg_attr( target_pointer_width = "16" , repr( C , align( 2 ) ) ) ]
166167#[ cfg_attr( target_pointer_width = "32" , repr( C , align( 4 ) ) ) ]
167168#[ cfg_attr( target_pointer_width = "64" , repr( C , align( 8 ) ) ) ]
@@ -1458,6 +1459,7 @@ macro_rules! atomic_int {
14581459 $stable_nand: meta,
14591460 $const_stable: meta,
14601461 $stable_init_const: meta,
1462+ $diagnostic_item: meta,
14611463 $s_int_type: literal,
14621464 $extra_feature: expr,
14631465 $min_fn: ident, $max_fn: ident,
@@ -1480,6 +1482,7 @@ macro_rules! atomic_int {
14801482 ///
14811483 /// [module-level documentation]: crate::sync::atomic
14821484 #[ $stable]
1485+ #[ $diagnostic_item]
14831486 #[ repr( C , align( $align) ) ]
14841487 pub struct $atomic_type {
14851488 v: UnsafeCell <$int_type>,
@@ -2306,6 +2309,7 @@ atomic_int! {
23062309 stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
23072310 rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
23082311 unstable( feature = "integer_atomics" , issue = "32976" ) ,
2312+ cfg_attr( not( test) , rustc_diagnostic_item = "AtomicI8" ) ,
23092313 "i8" ,
23102314 "" ,
23112315 atomic_min, atomic_max,
@@ -2325,6 +2329,7 @@ atomic_int! {
23252329 stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
23262330 rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
23272331 unstable( feature = "integer_atomics" , issue = "32976" ) ,
2332+ cfg_attr( not( test) , rustc_diagnostic_item = "AtomicU8" ) ,
23282333 "u8" ,
23292334 "" ,
23302335 atomic_umin, atomic_umax,
@@ -2344,6 +2349,7 @@ atomic_int! {
23442349 stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
23452350 rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
23462351 unstable( feature = "integer_atomics" , issue = "32976" ) ,
2352+ cfg_attr( not( test) , rustc_diagnostic_item = "AtomicI16" ) ,
23472353 "i16" ,
23482354 "" ,
23492355 atomic_min, atomic_max,
@@ -2363,6 +2369,7 @@ atomic_int! {
23632369 stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
23642370 rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
23652371 unstable( feature = "integer_atomics" , issue = "32976" ) ,
2372+ cfg_attr( not( test) , rustc_diagnostic_item = "AtomicU16" ) ,
23662373 "u16" ,
23672374 "" ,
23682375 atomic_umin, atomic_umax,
@@ -2382,6 +2389,7 @@ atomic_int! {
23822389 stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
23832390 rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
23842391 unstable( feature = "integer_atomics" , issue = "32976" ) ,
2392+ cfg_attr( not( test) , rustc_diagnostic_item = "AtomicI32" ) ,
23852393 "i32" ,
23862394 "" ,
23872395 atomic_min, atomic_max,
@@ -2401,6 +2409,7 @@ atomic_int! {
24012409 stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
24022410 rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
24032411 unstable( feature = "integer_atomics" , issue = "32976" ) ,
2412+ cfg_attr( not( test) , rustc_diagnostic_item = "AtomicU32" ) ,
24042413 "u32" ,
24052414 "" ,
24062415 atomic_umin, atomic_umax,
@@ -2420,6 +2429,7 @@ atomic_int! {
24202429 stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
24212430 rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
24222431 unstable( feature = "integer_atomics" , issue = "32976" ) ,
2432+ cfg_attr( not( test) , rustc_diagnostic_item = "AtomicI64" ) ,
24232433 "i64" ,
24242434 "" ,
24252435 atomic_min, atomic_max,
@@ -2439,6 +2449,7 @@ atomic_int! {
24392449 stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
24402450 rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
24412451 unstable( feature = "integer_atomics" , issue = "32976" ) ,
2452+ cfg_attr( not( test) , rustc_diagnostic_item = "AtomicU64" ) ,
24422453 "u64" ,
24432454 "" ,
24442455 atomic_umin, atomic_umax,
@@ -2458,6 +2469,7 @@ atomic_int! {
24582469 unstable( feature = "integer_atomics" , issue = "32976" ) ,
24592470 rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
24602471 unstable( feature = "integer_atomics" , issue = "32976" ) ,
2472+ cfg_attr( not( test) , rustc_diagnostic_item = "AtomicI128" ) ,
24612473 "i128" ,
24622474 "#![feature(integer_atomics)]\n \n " ,
24632475 atomic_min, atomic_max,
@@ -2477,6 +2489,7 @@ atomic_int! {
24772489 unstable( feature = "integer_atomics" , issue = "32976" ) ,
24782490 rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
24792491 unstable( feature = "integer_atomics" , issue = "32976" ) ,
2492+ cfg_attr( not( test) , rustc_diagnostic_item = "AtomicU128" ) ,
24802493 "u128" ,
24812494 "#![feature(integer_atomics)]\n \n " ,
24822495 atomic_umin, atomic_umax,
@@ -2500,6 +2513,7 @@ macro_rules! atomic_int_ptr_sized {
25002513 stable( feature = "atomic_nand" , since = "1.27.0" ) ,
25012514 rustc_const_stable( feature = "const_ptr_sized_atomics" , since = "1.24.0" ) ,
25022515 stable( feature = "rust1" , since = "1.0.0" ) ,
2516+ cfg_attr( not( test) , rustc_diagnostic_item = "AtomicIsize" ) ,
25032517 "isize" ,
25042518 "" ,
25052519 atomic_min, atomic_max,
@@ -2520,6 +2534,7 @@ macro_rules! atomic_int_ptr_sized {
25202534 stable( feature = "atomic_nand" , since = "1.27.0" ) ,
25212535 rustc_const_stable( feature = "const_ptr_sized_atomics" , since = "1.24.0" ) ,
25222536 stable( feature = "rust1" , since = "1.0.0" ) ,
2537+ cfg_attr( not( test) , rustc_diagnostic_item = "AtomicUsize" ) ,
25232538 "usize" ,
25242539 "" ,
25252540 atomic_umin, atomic_umax,
0 commit comments