Skip to content

Commit 438bfa3

Browse files
committed
fully deprecate and hide the legacy integral modules
1 parent 9f32ccf commit 438bfa3

File tree

6 files changed

+55
-40
lines changed

6 files changed

+55
-40
lines changed

library/core/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,10 @@ mod internal_macros;
255255
#[path = "num/shells/legacy_int_modules.rs"]
256256
mod legacy_int_modules;
257257
#[stable(feature = "rust1", since = "1.0.0")]
258-
#[allow(clippy::useless_attribute)] // FIXME false positive (https://github.com/rust-lang/rust-clippy/issues/15636)
259-
#[allow(deprecated_in_future)]
258+
#[allow(deprecated)]
260259
pub use legacy_int_modules::{i8, i16, i32, i64, isize, u8, u16, u32, u64, usize};
261260
#[stable(feature = "i128", since = "1.26.0")]
262-
#[allow(clippy::useless_attribute)] // FIXME false positive (https://github.com/rust-lang/rust-clippy/issues/15636)
263-
#[allow(deprecated_in_future)]
261+
#[allow(deprecated)]
264262
pub use legacy_int_modules::{i128, u128};
265263

266264
#[path = "num/f128.rs"]

library/core/src/num/f32.rs

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use crate::{cfg_select, intrinsics, mem};
3030
/// let r = f32::RADIX;
3131
/// ```
3232
#[stable(feature = "rust1", since = "1.0.0")]
33-
#[deprecated(since = "TBD", note = "replaced by the `RADIX` associated constant on `f32`")]
33+
#[deprecated(since = "1.92.0", note = "replaced by the `RADIX` associated constant on `f32`")]
3434
#[rustc_diagnostic_item = "f32_legacy_const_radix"]
3535
pub const RADIX: u32 = f32::RADIX;
3636

@@ -49,7 +49,7 @@ pub const RADIX: u32 = f32::RADIX;
4949
/// ```
5050
#[stable(feature = "rust1", since = "1.0.0")]
5151
#[deprecated(
52-
since = "TBD",
52+
since = "1.92.0",
5353
note = "replaced by the `MANTISSA_DIGITS` associated constant on `f32`"
5454
)]
5555
#[rustc_diagnostic_item = "f32_legacy_const_mantissa_dig"]
@@ -69,7 +69,7 @@ pub const MANTISSA_DIGITS: u32 = f32::MANTISSA_DIGITS;
6969
/// let d = f32::DIGITS;
7070
/// ```
7171
#[stable(feature = "rust1", since = "1.0.0")]
72-
#[deprecated(since = "TBD", note = "replaced by the `DIGITS` associated constant on `f32`")]
72+
#[deprecated(since = "1.92.0", note = "replaced by the `DIGITS` associated constant on `f32`")]
7373
#[rustc_diagnostic_item = "f32_legacy_const_digits"]
7474
pub const DIGITS: u32 = f32::DIGITS;
7575

@@ -91,7 +91,7 @@ pub const DIGITS: u32 = f32::DIGITS;
9191
/// let e = f32::EPSILON;
9292
/// ```
9393
#[stable(feature = "rust1", since = "1.0.0")]
94-
#[deprecated(since = "TBD", note = "replaced by the `EPSILON` associated constant on `f32`")]
94+
#[deprecated(since = "1.92.0", note = "replaced by the `EPSILON` associated constant on `f32`")]
9595
#[rustc_diagnostic_item = "f32_legacy_const_epsilon"]
9696
pub const EPSILON: f32 = f32::EPSILON;
9797

@@ -109,7 +109,7 @@ pub const EPSILON: f32 = f32::EPSILON;
109109
/// let min = f32::MIN;
110110
/// ```
111111
#[stable(feature = "rust1", since = "1.0.0")]
112-
#[deprecated(since = "TBD", note = "replaced by the `MIN` associated constant on `f32`")]
112+
#[deprecated(since = "1.92.0", note = "replaced by the `MIN` associated constant on `f32`")]
113113
#[rustc_diagnostic_item = "f32_legacy_const_min"]
114114
pub const MIN: f32 = f32::MIN;
115115

@@ -127,7 +127,10 @@ pub const MIN: f32 = f32::MIN;
127127
/// let min = f32::MIN_POSITIVE;
128128
/// ```
129129
#[stable(feature = "rust1", since = "1.0.0")]
130-
#[deprecated(since = "TBD", note = "replaced by the `MIN_POSITIVE` associated constant on `f32`")]
130+
#[deprecated(
131+
since = "1.92.0",
132+
note = "replaced by the `MIN_POSITIVE` associated constant on `f32`"
133+
)]
131134
#[rustc_diagnostic_item = "f32_legacy_const_min_positive"]
132135
pub const MIN_POSITIVE: f32 = f32::MIN_POSITIVE;
133136

@@ -145,7 +148,7 @@ pub const MIN_POSITIVE: f32 = f32::MIN_POSITIVE;
145148
/// let max = f32::MAX;
146149
/// ```
147150
#[stable(feature = "rust1", since = "1.0.0")]
148-
#[deprecated(since = "TBD", note = "replaced by the `MAX` associated constant on `f32`")]
151+
#[deprecated(since = "1.92.0", note = "replaced by the `MAX` associated constant on `f32`")]
149152
#[rustc_diagnostic_item = "f32_legacy_const_max"]
150153
pub const MAX: f32 = f32::MAX;
151154

@@ -163,7 +166,7 @@ pub const MAX: f32 = f32::MAX;
163166
/// let min = f32::MIN_EXP;
164167
/// ```
165168
#[stable(feature = "rust1", since = "1.0.0")]
166-
#[deprecated(since = "TBD", note = "replaced by the `MIN_EXP` associated constant on `f32`")]
169+
#[deprecated(since = "1.92.0", note = "replaced by the `MIN_EXP` associated constant on `f32`")]
167170
#[rustc_diagnostic_item = "f32_legacy_const_min_exp"]
168171
pub const MIN_EXP: i32 = f32::MIN_EXP;
169172

@@ -181,7 +184,7 @@ pub const MIN_EXP: i32 = f32::MIN_EXP;
181184
/// let max = f32::MAX_EXP;
182185
/// ```
183186
#[stable(feature = "rust1", since = "1.0.0")]
184-
#[deprecated(since = "TBD", note = "replaced by the `MAX_EXP` associated constant on `f32`")]
187+
#[deprecated(since = "1.92.0", note = "replaced by the `MAX_EXP` associated constant on `f32`")]
185188
#[rustc_diagnostic_item = "f32_legacy_const_max_exp"]
186189
pub const MAX_EXP: i32 = f32::MAX_EXP;
187190

@@ -199,7 +202,7 @@ pub const MAX_EXP: i32 = f32::MAX_EXP;
199202
/// let min = f32::MIN_10_EXP;
200203
/// ```
201204
#[stable(feature = "rust1", since = "1.0.0")]
202-
#[deprecated(since = "TBD", note = "replaced by the `MIN_10_EXP` associated constant on `f32`")]
205+
#[deprecated(since = "1.92.0", note = "replaced by the `MIN_10_EXP` associated constant on `f32`")]
203206
#[rustc_diagnostic_item = "f32_legacy_const_min_10_exp"]
204207
pub const MIN_10_EXP: i32 = f32::MIN_10_EXP;
205208

@@ -217,7 +220,7 @@ pub const MIN_10_EXP: i32 = f32::MIN_10_EXP;
217220
/// let max = f32::MAX_10_EXP;
218221
/// ```
219222
#[stable(feature = "rust1", since = "1.0.0")]
220-
#[deprecated(since = "TBD", note = "replaced by the `MAX_10_EXP` associated constant on `f32`")]
223+
#[deprecated(since = "1.92.0", note = "replaced by the `MAX_10_EXP` associated constant on `f32`")]
221224
#[rustc_diagnostic_item = "f32_legacy_const_max_10_exp"]
222225
pub const MAX_10_EXP: i32 = f32::MAX_10_EXP;
223226

@@ -235,7 +238,7 @@ pub const MAX_10_EXP: i32 = f32::MAX_10_EXP;
235238
/// let nan = f32::NAN;
236239
/// ```
237240
#[stable(feature = "rust1", since = "1.0.0")]
238-
#[deprecated(since = "TBD", note = "replaced by the `NAN` associated constant on `f32`")]
241+
#[deprecated(since = "1.92.0", note = "replaced by the `NAN` associated constant on `f32`")]
239242
#[rustc_diagnostic_item = "f32_legacy_const_nan"]
240243
pub const NAN: f32 = f32::NAN;
241244

@@ -253,7 +256,7 @@ pub const NAN: f32 = f32::NAN;
253256
/// let inf = f32::INFINITY;
254257
/// ```
255258
#[stable(feature = "rust1", since = "1.0.0")]
256-
#[deprecated(since = "TBD", note = "replaced by the `INFINITY` associated constant on `f32`")]
259+
#[deprecated(since = "1.92.0", note = "replaced by the `INFINITY` associated constant on `f32`")]
257260
#[rustc_diagnostic_item = "f32_legacy_const_infinity"]
258261
pub const INFINITY: f32 = f32::INFINITY;
259262

@@ -271,7 +274,10 @@ pub const INFINITY: f32 = f32::INFINITY;
271274
/// let ninf = f32::NEG_INFINITY;
272275
/// ```
273276
#[stable(feature = "rust1", since = "1.0.0")]
274-
#[deprecated(since = "TBD", note = "replaced by the `NEG_INFINITY` associated constant on `f32`")]
277+
#[deprecated(
278+
since = "1.92.0",
279+
note = "replaced by the `NEG_INFINITY` associated constant on `f32`"
280+
)]
275281
#[rustc_diagnostic_item = "f32_legacy_const_neg_infinity"]
276282
pub const NEG_INFINITY: f32 = f32::NEG_INFINITY;
277283

library/core/src/num/f64.rs

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use crate::{intrinsics, mem};
3030
/// let r = f64::RADIX;
3131
/// ```
3232
#[stable(feature = "rust1", since = "1.0.0")]
33-
#[deprecated(since = "TBD", note = "replaced by the `RADIX` associated constant on `f64`")]
33+
#[deprecated(since = "1.92.0", note = "replaced by the `RADIX` associated constant on `f64`")]
3434
#[rustc_diagnostic_item = "f64_legacy_const_radix"]
3535
pub const RADIX: u32 = f64::RADIX;
3636

@@ -49,7 +49,7 @@ pub const RADIX: u32 = f64::RADIX;
4949
/// ```
5050
#[stable(feature = "rust1", since = "1.0.0")]
5151
#[deprecated(
52-
since = "TBD",
52+
since = "1.92.0",
5353
note = "replaced by the `MANTISSA_DIGITS` associated constant on `f64`"
5454
)]
5555
#[rustc_diagnostic_item = "f64_legacy_const_mantissa_dig"]
@@ -69,7 +69,7 @@ pub const MANTISSA_DIGITS: u32 = f64::MANTISSA_DIGITS;
6969
/// let d = f64::DIGITS;
7070
/// ```
7171
#[stable(feature = "rust1", since = "1.0.0")]
72-
#[deprecated(since = "TBD", note = "replaced by the `DIGITS` associated constant on `f64`")]
72+
#[deprecated(since = "1.92.0", note = "replaced by the `DIGITS` associated constant on `f64`")]
7373
#[rustc_diagnostic_item = "f64_legacy_const_digits"]
7474
pub const DIGITS: u32 = f64::DIGITS;
7575

@@ -91,7 +91,7 @@ pub const DIGITS: u32 = f64::DIGITS;
9191
/// let e = f64::EPSILON;
9292
/// ```
9393
#[stable(feature = "rust1", since = "1.0.0")]
94-
#[deprecated(since = "TBD", note = "replaced by the `EPSILON` associated constant on `f64`")]
94+
#[deprecated(since = "1.92.0", note = "replaced by the `EPSILON` associated constant on `f64`")]
9595
#[rustc_diagnostic_item = "f64_legacy_const_epsilon"]
9696
pub const EPSILON: f64 = f64::EPSILON;
9797

@@ -109,7 +109,7 @@ pub const EPSILON: f64 = f64::EPSILON;
109109
/// let min = f64::MIN;
110110
/// ```
111111
#[stable(feature = "rust1", since = "1.0.0")]
112-
#[deprecated(since = "TBD", note = "replaced by the `MIN` associated constant on `f64`")]
112+
#[deprecated(since = "1.92.0", note = "replaced by the `MIN` associated constant on `f64`")]
113113
#[rustc_diagnostic_item = "f64_legacy_const_min"]
114114
pub const MIN: f64 = f64::MIN;
115115

@@ -127,7 +127,10 @@ pub const MIN: f64 = f64::MIN;
127127
/// let min = f64::MIN_POSITIVE;
128128
/// ```
129129
#[stable(feature = "rust1", since = "1.0.0")]
130-
#[deprecated(since = "TBD", note = "replaced by the `MIN_POSITIVE` associated constant on `f64`")]
130+
#[deprecated(
131+
since = "1.92.0",
132+
note = "replaced by the `MIN_POSITIVE` associated constant on `f64`"
133+
)]
131134
#[rustc_diagnostic_item = "f64_legacy_const_min_positive"]
132135
pub const MIN_POSITIVE: f64 = f64::MIN_POSITIVE;
133136

@@ -145,7 +148,7 @@ pub const MIN_POSITIVE: f64 = f64::MIN_POSITIVE;
145148
/// let max = f64::MAX;
146149
/// ```
147150
#[stable(feature = "rust1", since = "1.0.0")]
148-
#[deprecated(since = "TBD", note = "replaced by the `MAX` associated constant on `f64`")]
151+
#[deprecated(since = "1.92.0", note = "replaced by the `MAX` associated constant on `f64`")]
149152
#[rustc_diagnostic_item = "f64_legacy_const_max"]
150153
pub const MAX: f64 = f64::MAX;
151154

@@ -163,7 +166,7 @@ pub const MAX: f64 = f64::MAX;
163166
/// let min = f64::MIN_EXP;
164167
/// ```
165168
#[stable(feature = "rust1", since = "1.0.0")]
166-
#[deprecated(since = "TBD", note = "replaced by the `MIN_EXP` associated constant on `f64`")]
169+
#[deprecated(since = "1.92.0", note = "replaced by the `MIN_EXP` associated constant on `f64`")]
167170
#[rustc_diagnostic_item = "f64_legacy_const_min_exp"]
168171
pub const MIN_EXP: i32 = f64::MIN_EXP;
169172

@@ -181,7 +184,7 @@ pub const MIN_EXP: i32 = f64::MIN_EXP;
181184
/// let max = f64::MAX_EXP;
182185
/// ```
183186
#[stable(feature = "rust1", since = "1.0.0")]
184-
#[deprecated(since = "TBD", note = "replaced by the `MAX_EXP` associated constant on `f64`")]
187+
#[deprecated(since = "1.92.0", note = "replaced by the `MAX_EXP` associated constant on `f64`")]
185188
#[rustc_diagnostic_item = "f64_legacy_const_max_exp"]
186189
pub const MAX_EXP: i32 = f64::MAX_EXP;
187190

@@ -199,7 +202,7 @@ pub const MAX_EXP: i32 = f64::MAX_EXP;
199202
/// let min = f64::MIN_10_EXP;
200203
/// ```
201204
#[stable(feature = "rust1", since = "1.0.0")]
202-
#[deprecated(since = "TBD", note = "replaced by the `MIN_10_EXP` associated constant on `f64`")]
205+
#[deprecated(since = "1.92.0", note = "replaced by the `MIN_10_EXP` associated constant on `f64`")]
203206
#[rustc_diagnostic_item = "f64_legacy_const_min_10_exp"]
204207
pub const MIN_10_EXP: i32 = f64::MIN_10_EXP;
205208

@@ -217,7 +220,7 @@ pub const MIN_10_EXP: i32 = f64::MIN_10_EXP;
217220
/// let max = f64::MAX_10_EXP;
218221
/// ```
219222
#[stable(feature = "rust1", since = "1.0.0")]
220-
#[deprecated(since = "TBD", note = "replaced by the `MAX_10_EXP` associated constant on `f64`")]
223+
#[deprecated(since = "1.92.0", note = "replaced by the `MAX_10_EXP` associated constant on `f64`")]
221224
#[rustc_diagnostic_item = "f64_legacy_const_max_10_exp"]
222225
pub const MAX_10_EXP: i32 = f64::MAX_10_EXP;
223226

@@ -235,7 +238,7 @@ pub const MAX_10_EXP: i32 = f64::MAX_10_EXP;
235238
/// let nan = f64::NAN;
236239
/// ```
237240
#[stable(feature = "rust1", since = "1.0.0")]
238-
#[deprecated(since = "TBD", note = "replaced by the `NAN` associated constant on `f64`")]
241+
#[deprecated(since = "1.92.0", note = "replaced by the `NAN` associated constant on `f64`")]
239242
#[rustc_diagnostic_item = "f64_legacy_const_nan"]
240243
pub const NAN: f64 = f64::NAN;
241244

@@ -253,7 +256,7 @@ pub const NAN: f64 = f64::NAN;
253256
/// let inf = f64::INFINITY;
254257
/// ```
255258
#[stable(feature = "rust1", since = "1.0.0")]
256-
#[deprecated(since = "TBD", note = "replaced by the `INFINITY` associated constant on `f64`")]
259+
#[deprecated(since = "1.92.0", note = "replaced by the `INFINITY` associated constant on `f64`")]
257260
#[rustc_diagnostic_item = "f64_legacy_const_infinity"]
258261
pub const INFINITY: f64 = f64::INFINITY;
259262

@@ -271,7 +274,10 @@ pub const INFINITY: f64 = f64::INFINITY;
271274
/// let ninf = f64::NEG_INFINITY;
272275
/// ```
273276
#[stable(feature = "rust1", since = "1.0.0")]
274-
#[deprecated(since = "TBD", note = "replaced by the `NEG_INFINITY` associated constant on `f64`")]
277+
#[deprecated(
278+
since = "1.92.0",
279+
note = "replaced by the `NEG_INFINITY` associated constant on `f64`"
280+
)]
275281
#[rustc_diagnostic_item = "f64_legacy_const_neg_infinity"]
276282
pub const NEG_INFINITY: f64 = f64::NEG_INFINITY;
277283

library/core/src/num/int_macros.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3830,7 +3830,8 @@ macro_rules! int_impl {
38303830
#[inline(always)]
38313831
#[rustc_promotable]
38323832
#[rustc_const_stable(feature = "const_min_value", since = "1.32.0")]
3833-
#[deprecated(since = "TBD", note = "replaced by the `MIN` associated constant on this type")]
3833+
#[deprecated(since = "1.92.0", note = "replaced by the `MIN` associated constant on this type")]
3834+
#[doc(hidden)]
38343835
#[rustc_diagnostic_item = concat!(stringify!($SelfT), "_legacy_fn_min_value")]
38353836
pub const fn min_value() -> Self {
38363837
Self::MIN
@@ -3844,7 +3845,8 @@ macro_rules! int_impl {
38443845
#[inline(always)]
38453846
#[rustc_promotable]
38463847
#[rustc_const_stable(feature = "const_max_value", since = "1.32.0")]
3847-
#[deprecated(since = "TBD", note = "replaced by the `MAX` associated constant on this type")]
3848+
#[deprecated(since = "1.92.0", note = "replaced by the `MAX` associated constant on this type")]
3849+
#[doc(hidden)]
38483850
#[rustc_diagnostic_item = concat!(stringify!($SelfT), "_legacy_fn_max_value")]
38493851
pub const fn max_value() -> Self {
38503852
Self::MAX

library/core/src/num/shells/legacy_int_modules.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ macro_rules! legacy_int_module {
55
($T:ident, #[$attr:meta]) => (
66
#[$attr]
77
#[deprecated(
8-
since = "TBD",
9-
note = "all constants in this module replaced by associated constants on the type"
8+
since = "1.92.0",
9+
note = "all constants in this module replaced by associated constants on the type",
1010
)]
11+
#[doc(hidden)]
1112
#[rustc_diagnostic_item = concat!(stringify!($T), "_legacy_mod")]
1213
pub mod $T {
1314
#![doc = concat!("Redundant constants module for the [`", stringify!($T), "` primitive type][", stringify!($T), "].")]
@@ -30,7 +31,7 @@ macro_rules! legacy_int_module {
3031
/// ```
3132
///
3233
#[$attr]
33-
#[deprecated(since = "TBD", note = "replaced by the `MIN` associated constant on this type")]
34+
#[deprecated(since = "1.92.0", note = "replaced by the `MIN` associated constant on this type")]
3435
#[rustc_diagnostic_item = concat!(stringify!($T), "_legacy_const_min")]
3536
pub const MIN: $T = $T::MIN;
3637

@@ -50,7 +51,7 @@ macro_rules! legacy_int_module {
5051
/// ```
5152
///
5253
#[$attr]
53-
#[deprecated(since = "TBD", note = "replaced by the `MAX` associated constant on this type")]
54+
#[deprecated(since = "1.92.0", note = "replaced by the `MAX` associated constant on this type")]
5455
#[rustc_diagnostic_item = concat!(stringify!($T), "_legacy_const_max")]
5556
pub const MAX: $T = $T::MAX;
5657
}

library/core/src/num/uint_macros.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3852,7 +3852,8 @@ macro_rules! uint_impl {
38523852
#[rustc_promotable]
38533853
#[inline(always)]
38543854
#[rustc_const_stable(feature = "const_max_value", since = "1.32.0")]
3855-
#[deprecated(since = "TBD", note = "replaced by the `MIN` associated constant on this type")]
3855+
#[deprecated(since = "1.92.0", note = "replaced by the `MIN` associated constant on this type")]
3856+
#[doc(hidden)]
38563857
#[rustc_diagnostic_item = concat!(stringify!($SelfT), "_legacy_fn_min_value")]
38573858
pub const fn min_value() -> Self { Self::MIN }
38583859

@@ -3864,7 +3865,8 @@ macro_rules! uint_impl {
38643865
#[rustc_promotable]
38653866
#[inline(always)]
38663867
#[rustc_const_stable(feature = "const_max_value", since = "1.32.0")]
3867-
#[deprecated(since = "TBD", note = "replaced by the `MAX` associated constant on this type")]
3868+
#[deprecated(since = "1.92.0", note = "replaced by the `MAX` associated constant on this type")]
3869+
#[doc(hidden)]
38683870
#[rustc_diagnostic_item = concat!(stringify!($SelfT), "_legacy_fn_max_value")]
38693871
pub const fn max_value() -> Self { Self::MAX }
38703872
}

0 commit comments

Comments
 (0)