@@ -1958,14 +1958,12 @@ macro_rules! atomic_int {
1958
1958
$stable_from: meta,
1959
1959
$stable_nand: meta,
1960
1960
$const_stable: meta,
1961
- $stable_init_const: meta,
1962
1961
$diagnostic_item: meta,
1963
1962
$s_int_type: literal,
1964
1963
$extra_feature: expr,
1965
1964
$min_fn: ident, $max_fn: ident,
1966
1965
$align: expr,
1967
- $atomic_new: expr,
1968
- $int_type: ident $atomic_type: ident $atomic_init: ident) => {
1966
+ $int_type: ident $atomic_type: ident) => {
1969
1967
/// An integer type which can be safely shared between threads.
1970
1968
///
1971
1969
/// This type has the same in-memory representation as the underlying
@@ -1988,15 +1986,6 @@ macro_rules! atomic_int {
1988
1986
v: UnsafeCell <$int_type>,
1989
1987
}
1990
1988
1991
- /// An atomic integer initialized to `0`.
1992
- #[ $stable_init_const]
1993
- #[ deprecated(
1994
- since = "1.34.0" ,
1995
- note = "the `new` function is now preferred" ,
1996
- suggestion = $atomic_new,
1997
- ) ]
1998
- pub const $atomic_init: $atomic_type = $atomic_type:: new( 0 ) ;
1999
-
2000
1989
#[ $stable]
2001
1990
impl Default for $atomic_type {
2002
1991
#[ inline]
@@ -2874,14 +2863,12 @@ atomic_int! {
2874
2863
stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
2875
2864
stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
2876
2865
rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
2877
- unstable( feature = "integer_atomics" , issue = "99069" ) ,
2878
2866
cfg_attr( not( test) , rustc_diagnostic_item = "AtomicI8" ) ,
2879
2867
"i8" ,
2880
2868
"" ,
2881
2869
atomic_min, atomic_max,
2882
2870
1 ,
2883
- "AtomicI8::new(0)" ,
2884
- i8 AtomicI8 ATOMIC_I8_INIT
2871
+ i8 AtomicI8
2885
2872
}
2886
2873
#[ cfg( target_has_atomic_load_store = "8" ) ]
2887
2874
atomic_int ! {
@@ -2894,14 +2881,12 @@ atomic_int! {
2894
2881
stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
2895
2882
stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
2896
2883
rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
2897
- unstable( feature = "integer_atomics" , issue = "99069" ) ,
2898
2884
cfg_attr( not( test) , rustc_diagnostic_item = "AtomicU8" ) ,
2899
2885
"u8" ,
2900
2886
"" ,
2901
2887
atomic_umin, atomic_umax,
2902
2888
1 ,
2903
- "AtomicU8::new(0)" ,
2904
- u8 AtomicU8 ATOMIC_U8_INIT
2889
+ u8 AtomicU8
2905
2890
}
2906
2891
#[ cfg( target_has_atomic_load_store = "16" ) ]
2907
2892
atomic_int ! {
@@ -2914,14 +2899,12 @@ atomic_int! {
2914
2899
stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
2915
2900
stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
2916
2901
rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
2917
- unstable( feature = "integer_atomics" , issue = "99069" ) ,
2918
2902
cfg_attr( not( test) , rustc_diagnostic_item = "AtomicI16" ) ,
2919
2903
"i16" ,
2920
2904
"" ,
2921
2905
atomic_min, atomic_max,
2922
2906
2 ,
2923
- "AtomicI16::new(0)" ,
2924
- i16 AtomicI16 ATOMIC_I16_INIT
2907
+ i16 AtomicI16
2925
2908
}
2926
2909
#[ cfg( target_has_atomic_load_store = "16" ) ]
2927
2910
atomic_int ! {
@@ -2934,14 +2917,12 @@ atomic_int! {
2934
2917
stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
2935
2918
stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
2936
2919
rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
2937
- unstable( feature = "integer_atomics" , issue = "99069" ) ,
2938
2920
cfg_attr( not( test) , rustc_diagnostic_item = "AtomicU16" ) ,
2939
2921
"u16" ,
2940
2922
"" ,
2941
2923
atomic_umin, atomic_umax,
2942
2924
2 ,
2943
- "AtomicU16::new(0)" ,
2944
- u16 AtomicU16 ATOMIC_U16_INIT
2925
+ u16 AtomicU16
2945
2926
}
2946
2927
#[ cfg( target_has_atomic_load_store = "32" ) ]
2947
2928
atomic_int ! {
@@ -2954,14 +2935,12 @@ atomic_int! {
2954
2935
stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
2955
2936
stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
2956
2937
rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
2957
- unstable( feature = "integer_atomics" , issue = "99069" ) ,
2958
2938
cfg_attr( not( test) , rustc_diagnostic_item = "AtomicI32" ) ,
2959
2939
"i32" ,
2960
2940
"" ,
2961
2941
atomic_min, atomic_max,
2962
2942
4 ,
2963
- "AtomicI32::new(0)" ,
2964
- i32 AtomicI32 ATOMIC_I32_INIT
2943
+ i32 AtomicI32
2965
2944
}
2966
2945
#[ cfg( target_has_atomic_load_store = "32" ) ]
2967
2946
atomic_int ! {
@@ -2974,14 +2953,12 @@ atomic_int! {
2974
2953
stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
2975
2954
stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
2976
2955
rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
2977
- unstable( feature = "integer_atomics" , issue = "99069" ) ,
2978
2956
cfg_attr( not( test) , rustc_diagnostic_item = "AtomicU32" ) ,
2979
2957
"u32" ,
2980
2958
"" ,
2981
2959
atomic_umin, atomic_umax,
2982
2960
4 ,
2983
- "AtomicU32::new(0)" ,
2984
- u32 AtomicU32 ATOMIC_U32_INIT
2961
+ u32 AtomicU32
2985
2962
}
2986
2963
#[ cfg( target_has_atomic_load_store = "64" ) ]
2987
2964
atomic_int ! {
@@ -2994,14 +2971,12 @@ atomic_int! {
2994
2971
stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
2995
2972
stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
2996
2973
rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
2997
- unstable( feature = "integer_atomics" , issue = "99069" ) ,
2998
2974
cfg_attr( not( test) , rustc_diagnostic_item = "AtomicI64" ) ,
2999
2975
"i64" ,
3000
2976
"" ,
3001
2977
atomic_min, atomic_max,
3002
2978
8 ,
3003
- "AtomicI64::new(0)" ,
3004
- i64 AtomicI64 ATOMIC_I64_INIT
2979
+ i64 AtomicI64
3005
2980
}
3006
2981
#[ cfg( target_has_atomic_load_store = "64" ) ]
3007
2982
atomic_int ! {
@@ -3014,14 +2989,12 @@ atomic_int! {
3014
2989
stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
3015
2990
stable( feature = "integer_atomics_stable" , since = "1.34.0" ) ,
3016
2991
rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
3017
- unstable( feature = "integer_atomics" , issue = "99069" ) ,
3018
2992
cfg_attr( not( test) , rustc_diagnostic_item = "AtomicU64" ) ,
3019
2993
"u64" ,
3020
2994
"" ,
3021
2995
atomic_umin, atomic_umax,
3022
2996
8 ,
3023
- "AtomicU64::new(0)" ,
3024
- u64 AtomicU64 ATOMIC_U64_INIT
2997
+ u64 AtomicU64
3025
2998
}
3026
2999
#[ cfg( target_has_atomic_load_store = "128" ) ]
3027
3000
atomic_int ! {
@@ -3034,14 +3007,12 @@ atomic_int! {
3034
3007
unstable( feature = "integer_atomics" , issue = "99069" ) ,
3035
3008
unstable( feature = "integer_atomics" , issue = "99069" ) ,
3036
3009
rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
3037
- unstable( feature = "integer_atomics" , issue = "99069" ) ,
3038
3010
cfg_attr( not( test) , rustc_diagnostic_item = "AtomicI128" ) ,
3039
3011
"i128" ,
3040
3012
"#![feature(integer_atomics)]\n \n " ,
3041
3013
atomic_min, atomic_max,
3042
3014
16 ,
3043
- "AtomicI128::new(0)" ,
3044
- i128 AtomicI128 ATOMIC_I128_INIT
3015
+ i128 AtomicI128
3045
3016
}
3046
3017
#[ cfg( target_has_atomic_load_store = "128" ) ]
3047
3018
atomic_int ! {
@@ -3054,19 +3025,17 @@ atomic_int! {
3054
3025
unstable( feature = "integer_atomics" , issue = "99069" ) ,
3055
3026
unstable( feature = "integer_atomics" , issue = "99069" ) ,
3056
3027
rustc_const_stable( feature = "const_integer_atomics" , since = "1.34.0" ) ,
3057
- unstable( feature = "integer_atomics" , issue = "99069" ) ,
3058
3028
cfg_attr( not( test) , rustc_diagnostic_item = "AtomicU128" ) ,
3059
3029
"u128" ,
3060
3030
"#![feature(integer_atomics)]\n \n " ,
3061
3031
atomic_umin, atomic_umax,
3062
3032
16 ,
3063
- "AtomicU128::new(0)" ,
3064
- u128 AtomicU128 ATOMIC_U128_INIT
3033
+ u128 AtomicU128
3065
3034
}
3066
3035
3036
+ #[ cfg( target_has_atomic_load_store = "ptr" ) ]
3067
3037
macro_rules! atomic_int_ptr_sized {
3068
3038
( $( $target_pointer_width: literal $align: literal) * ) => { $(
3069
- #[ cfg( target_has_atomic_load_store = "ptr" ) ]
3070
3039
#[ cfg( target_pointer_width = $target_pointer_width) ]
3071
3040
atomic_int! {
3072
3041
cfg( target_has_atomic = "ptr" ) ,
@@ -3078,16 +3047,13 @@ macro_rules! atomic_int_ptr_sized {
3078
3047
stable( feature = "atomic_from" , since = "1.23.0" ) ,
3079
3048
stable( feature = "atomic_nand" , since = "1.27.0" ) ,
3080
3049
rustc_const_stable( feature = "const_ptr_sized_atomics" , since = "1.24.0" ) ,
3081
- stable( feature = "rust1" , since = "1.0.0" ) ,
3082
3050
cfg_attr( not( test) , rustc_diagnostic_item = "AtomicIsize" ) ,
3083
3051
"isize" ,
3084
3052
"" ,
3085
3053
atomic_min, atomic_max,
3086
3054
$align,
3087
- "AtomicIsize::new(0)" ,
3088
- isize AtomicIsize ATOMIC_ISIZE_INIT
3055
+ isize AtomicIsize
3089
3056
}
3090
- #[ cfg( target_has_atomic_load_store = "ptr" ) ]
3091
3057
#[ cfg( target_pointer_width = $target_pointer_width) ]
3092
3058
atomic_int! {
3093
3059
cfg( target_has_atomic = "ptr" ) ,
@@ -3099,18 +3065,37 @@ macro_rules! atomic_int_ptr_sized {
3099
3065
stable( feature = "atomic_from" , since = "1.23.0" ) ,
3100
3066
stable( feature = "atomic_nand" , since = "1.27.0" ) ,
3101
3067
rustc_const_stable( feature = "const_ptr_sized_atomics" , since = "1.24.0" ) ,
3102
- stable( feature = "rust1" , since = "1.0.0" ) ,
3103
3068
cfg_attr( not( test) , rustc_diagnostic_item = "AtomicUsize" ) ,
3104
3069
"usize" ,
3105
3070
"" ,
3106
3071
atomic_umin, atomic_umax,
3107
3072
$align,
3108
- "AtomicUsize::new(0)" ,
3109
- usize AtomicUsize ATOMIC_USIZE_INIT
3073
+ usize AtomicUsize
3110
3074
}
3075
+
3076
+ /// An [`AtomicIsize`] initialized to `0`.
3077
+ #[ cfg( target_pointer_width = $target_pointer_width) ]
3078
+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
3079
+ #[ deprecated(
3080
+ since = "1.34.0" ,
3081
+ note = "the `new` function is now preferred" ,
3082
+ suggestion = "AtomicIsize::new(0)" ,
3083
+ ) ]
3084
+ pub const ATOMIC_ISIZE_INIT : AtomicIsize = AtomicIsize :: new( 0 ) ;
3085
+
3086
+ /// An [`AtomicUsize`] initialized to `0`.
3087
+ #[ cfg( target_pointer_width = $target_pointer_width) ]
3088
+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
3089
+ #[ deprecated(
3090
+ since = "1.34.0" ,
3091
+ note = "the `new` function is now preferred" ,
3092
+ suggestion = "AtomicUsize::new(0)" ,
3093
+ ) ]
3094
+ pub const ATOMIC_USIZE_INIT : AtomicUsize = AtomicUsize :: new( 0 ) ;
3111
3095
) * } ;
3112
3096
}
3113
3097
3098
+ #[ cfg( target_has_atomic_load_store = "ptr" ) ]
3114
3099
atomic_int_ptr_sized ! {
3115
3100
"16" 2
3116
3101
"32" 4
0 commit comments