From 7fa9c6a7ff515a55fe1730c6188b18b254c758f3 Mon Sep 17 00:00:00 2001 From: cyrgani Date: Mon, 22 Sep 2025 15:09:43 +0200 Subject: [PATCH] fully deprecate the legacy integral modules --- library/core/src/lib.rs | 6 ++-- library/core/src/num/f32.rs | 34 +++++++++++-------- library/core/src/num/f64.rs | 34 +++++++++++-------- library/core/src/num/int_macros.rs | 4 +-- .../core/src/num/shells/legacy_int_modules.rs | 8 ++--- library/core/src/num/uint_macros.rs | 4 +-- 6 files changed, 50 insertions(+), 40 deletions(-) diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index 5d52bfb1b125f..4e09b4a1d2af9 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -255,12 +255,10 @@ mod internal_macros; #[path = "num/shells/legacy_int_modules.rs"] mod legacy_int_modules; #[stable(feature = "rust1", since = "1.0.0")] -#[allow(clippy::useless_attribute)] // FIXME false positive (https://github.com/rust-lang/rust-clippy/issues/15636) -#[allow(deprecated_in_future)] +#[allow(deprecated)] pub use legacy_int_modules::{i8, i16, i32, i64, isize, u8, u16, u32, u64, usize}; #[stable(feature = "i128", since = "1.26.0")] -#[allow(clippy::useless_attribute)] // FIXME false positive (https://github.com/rust-lang/rust-clippy/issues/15636) -#[allow(deprecated_in_future)] +#[allow(deprecated)] pub use legacy_int_modules::{i128, u128}; #[path = "num/f128.rs"] diff --git a/library/core/src/num/f32.rs b/library/core/src/num/f32.rs index cefcf1d1fe2fc..c2fe39a368c96 100644 --- a/library/core/src/num/f32.rs +++ b/library/core/src/num/f32.rs @@ -30,7 +30,7 @@ use crate::{cfg_select, intrinsics, mem}; /// let r = f32::RADIX; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[deprecated(since = "TBD", note = "replaced by the `RADIX` associated constant on `f32`")] +#[deprecated(since = "1.92.0", note = "replaced by the `RADIX` associated constant on `f32`")] #[rustc_diagnostic_item = "f32_legacy_const_radix"] pub const RADIX: u32 = f32::RADIX; @@ -49,7 +49,7 @@ pub const RADIX: u32 = f32::RADIX; /// ``` #[stable(feature = "rust1", since = "1.0.0")] #[deprecated( - since = "TBD", + since = "1.92.0", note = "replaced by the `MANTISSA_DIGITS` associated constant on `f32`" )] #[rustc_diagnostic_item = "f32_legacy_const_mantissa_dig"] @@ -69,7 +69,7 @@ pub const MANTISSA_DIGITS: u32 = f32::MANTISSA_DIGITS; /// let d = f32::DIGITS; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[deprecated(since = "TBD", note = "replaced by the `DIGITS` associated constant on `f32`")] +#[deprecated(since = "1.92.0", note = "replaced by the `DIGITS` associated constant on `f32`")] #[rustc_diagnostic_item = "f32_legacy_const_digits"] pub const DIGITS: u32 = f32::DIGITS; @@ -91,7 +91,7 @@ pub const DIGITS: u32 = f32::DIGITS; /// let e = f32::EPSILON; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[deprecated(since = "TBD", note = "replaced by the `EPSILON` associated constant on `f32`")] +#[deprecated(since = "1.92.0", note = "replaced by the `EPSILON` associated constant on `f32`")] #[rustc_diagnostic_item = "f32_legacy_const_epsilon"] pub const EPSILON: f32 = f32::EPSILON; @@ -109,7 +109,7 @@ pub const EPSILON: f32 = f32::EPSILON; /// let min = f32::MIN; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[deprecated(since = "TBD", note = "replaced by the `MIN` associated constant on `f32`")] +#[deprecated(since = "1.92.0", note = "replaced by the `MIN` associated constant on `f32`")] #[rustc_diagnostic_item = "f32_legacy_const_min"] pub const MIN: f32 = f32::MIN; @@ -127,7 +127,10 @@ pub const MIN: f32 = f32::MIN; /// let min = f32::MIN_POSITIVE; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[deprecated(since = "TBD", note = "replaced by the `MIN_POSITIVE` associated constant on `f32`")] +#[deprecated( + since = "1.92.0", + note = "replaced by the `MIN_POSITIVE` associated constant on `f32`" +)] #[rustc_diagnostic_item = "f32_legacy_const_min_positive"] pub const MIN_POSITIVE: f32 = f32::MIN_POSITIVE; @@ -145,7 +148,7 @@ pub const MIN_POSITIVE: f32 = f32::MIN_POSITIVE; /// let max = f32::MAX; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[deprecated(since = "TBD", note = "replaced by the `MAX` associated constant on `f32`")] +#[deprecated(since = "1.92.0", note = "replaced by the `MAX` associated constant on `f32`")] #[rustc_diagnostic_item = "f32_legacy_const_max"] pub const MAX: f32 = f32::MAX; @@ -163,7 +166,7 @@ pub const MAX: f32 = f32::MAX; /// let min = f32::MIN_EXP; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[deprecated(since = "TBD", note = "replaced by the `MIN_EXP` associated constant on `f32`")] +#[deprecated(since = "1.92.0", note = "replaced by the `MIN_EXP` associated constant on `f32`")] #[rustc_diagnostic_item = "f32_legacy_const_min_exp"] pub const MIN_EXP: i32 = f32::MIN_EXP; @@ -181,7 +184,7 @@ pub const MIN_EXP: i32 = f32::MIN_EXP; /// let max = f32::MAX_EXP; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[deprecated(since = "TBD", note = "replaced by the `MAX_EXP` associated constant on `f32`")] +#[deprecated(since = "1.92.0", note = "replaced by the `MAX_EXP` associated constant on `f32`")] #[rustc_diagnostic_item = "f32_legacy_const_max_exp"] pub const MAX_EXP: i32 = f32::MAX_EXP; @@ -199,7 +202,7 @@ pub const MAX_EXP: i32 = f32::MAX_EXP; /// let min = f32::MIN_10_EXP; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[deprecated(since = "TBD", note = "replaced by the `MIN_10_EXP` associated constant on `f32`")] +#[deprecated(since = "1.92.0", note = "replaced by the `MIN_10_EXP` associated constant on `f32`")] #[rustc_diagnostic_item = "f32_legacy_const_min_10_exp"] pub const MIN_10_EXP: i32 = f32::MIN_10_EXP; @@ -217,7 +220,7 @@ pub const MIN_10_EXP: i32 = f32::MIN_10_EXP; /// let max = f32::MAX_10_EXP; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[deprecated(since = "TBD", note = "replaced by the `MAX_10_EXP` associated constant on `f32`")] +#[deprecated(since = "1.92.0", note = "replaced by the `MAX_10_EXP` associated constant on `f32`")] #[rustc_diagnostic_item = "f32_legacy_const_max_10_exp"] pub const MAX_10_EXP: i32 = f32::MAX_10_EXP; @@ -235,7 +238,7 @@ pub const MAX_10_EXP: i32 = f32::MAX_10_EXP; /// let nan = f32::NAN; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[deprecated(since = "TBD", note = "replaced by the `NAN` associated constant on `f32`")] +#[deprecated(since = "1.92.0", note = "replaced by the `NAN` associated constant on `f32`")] #[rustc_diagnostic_item = "f32_legacy_const_nan"] pub const NAN: f32 = f32::NAN; @@ -253,7 +256,7 @@ pub const NAN: f32 = f32::NAN; /// let inf = f32::INFINITY; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[deprecated(since = "TBD", note = "replaced by the `INFINITY` associated constant on `f32`")] +#[deprecated(since = "1.92.0", note = "replaced by the `INFINITY` associated constant on `f32`")] #[rustc_diagnostic_item = "f32_legacy_const_infinity"] pub const INFINITY: f32 = f32::INFINITY; @@ -271,7 +274,10 @@ pub const INFINITY: f32 = f32::INFINITY; /// let ninf = f32::NEG_INFINITY; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[deprecated(since = "TBD", note = "replaced by the `NEG_INFINITY` associated constant on `f32`")] +#[deprecated( + since = "1.92.0", + note = "replaced by the `NEG_INFINITY` associated constant on `f32`" +)] #[rustc_diagnostic_item = "f32_legacy_const_neg_infinity"] pub const NEG_INFINITY: f32 = f32::NEG_INFINITY; diff --git a/library/core/src/num/f64.rs b/library/core/src/num/f64.rs index 9dd1141e70331..a88a322099050 100644 --- a/library/core/src/num/f64.rs +++ b/library/core/src/num/f64.rs @@ -30,7 +30,7 @@ use crate::{intrinsics, mem}; /// let r = f64::RADIX; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[deprecated(since = "TBD", note = "replaced by the `RADIX` associated constant on `f64`")] +#[deprecated(since = "1.92.0", note = "replaced by the `RADIX` associated constant on `f64`")] #[rustc_diagnostic_item = "f64_legacy_const_radix"] pub const RADIX: u32 = f64::RADIX; @@ -49,7 +49,7 @@ pub const RADIX: u32 = f64::RADIX; /// ``` #[stable(feature = "rust1", since = "1.0.0")] #[deprecated( - since = "TBD", + since = "1.92.0", note = "replaced by the `MANTISSA_DIGITS` associated constant on `f64`" )] #[rustc_diagnostic_item = "f64_legacy_const_mantissa_dig"] @@ -69,7 +69,7 @@ pub const MANTISSA_DIGITS: u32 = f64::MANTISSA_DIGITS; /// let d = f64::DIGITS; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[deprecated(since = "TBD", note = "replaced by the `DIGITS` associated constant on `f64`")] +#[deprecated(since = "1.92.0", note = "replaced by the `DIGITS` associated constant on `f64`")] #[rustc_diagnostic_item = "f64_legacy_const_digits"] pub const DIGITS: u32 = f64::DIGITS; @@ -91,7 +91,7 @@ pub const DIGITS: u32 = f64::DIGITS; /// let e = f64::EPSILON; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[deprecated(since = "TBD", note = "replaced by the `EPSILON` associated constant on `f64`")] +#[deprecated(since = "1.92.0", note = "replaced by the `EPSILON` associated constant on `f64`")] #[rustc_diagnostic_item = "f64_legacy_const_epsilon"] pub const EPSILON: f64 = f64::EPSILON; @@ -109,7 +109,7 @@ pub const EPSILON: f64 = f64::EPSILON; /// let min = f64::MIN; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[deprecated(since = "TBD", note = "replaced by the `MIN` associated constant on `f64`")] +#[deprecated(since = "1.92.0", note = "replaced by the `MIN` associated constant on `f64`")] #[rustc_diagnostic_item = "f64_legacy_const_min"] pub const MIN: f64 = f64::MIN; @@ -127,7 +127,10 @@ pub const MIN: f64 = f64::MIN; /// let min = f64::MIN_POSITIVE; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[deprecated(since = "TBD", note = "replaced by the `MIN_POSITIVE` associated constant on `f64`")] +#[deprecated( + since = "1.92.0", + note = "replaced by the `MIN_POSITIVE` associated constant on `f64`" +)] #[rustc_diagnostic_item = "f64_legacy_const_min_positive"] pub const MIN_POSITIVE: f64 = f64::MIN_POSITIVE; @@ -145,7 +148,7 @@ pub const MIN_POSITIVE: f64 = f64::MIN_POSITIVE; /// let max = f64::MAX; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[deprecated(since = "TBD", note = "replaced by the `MAX` associated constant on `f64`")] +#[deprecated(since = "1.92.0", note = "replaced by the `MAX` associated constant on `f64`")] #[rustc_diagnostic_item = "f64_legacy_const_max"] pub const MAX: f64 = f64::MAX; @@ -163,7 +166,7 @@ pub const MAX: f64 = f64::MAX; /// let min = f64::MIN_EXP; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[deprecated(since = "TBD", note = "replaced by the `MIN_EXP` associated constant on `f64`")] +#[deprecated(since = "1.92.0", note = "replaced by the `MIN_EXP` associated constant on `f64`")] #[rustc_diagnostic_item = "f64_legacy_const_min_exp"] pub const MIN_EXP: i32 = f64::MIN_EXP; @@ -181,7 +184,7 @@ pub const MIN_EXP: i32 = f64::MIN_EXP; /// let max = f64::MAX_EXP; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[deprecated(since = "TBD", note = "replaced by the `MAX_EXP` associated constant on `f64`")] +#[deprecated(since = "1.92.0", note = "replaced by the `MAX_EXP` associated constant on `f64`")] #[rustc_diagnostic_item = "f64_legacy_const_max_exp"] pub const MAX_EXP: i32 = f64::MAX_EXP; @@ -199,7 +202,7 @@ pub const MAX_EXP: i32 = f64::MAX_EXP; /// let min = f64::MIN_10_EXP; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[deprecated(since = "TBD", note = "replaced by the `MIN_10_EXP` associated constant on `f64`")] +#[deprecated(since = "1.92.0", note = "replaced by the `MIN_10_EXP` associated constant on `f64`")] #[rustc_diagnostic_item = "f64_legacy_const_min_10_exp"] pub const MIN_10_EXP: i32 = f64::MIN_10_EXP; @@ -217,7 +220,7 @@ pub const MIN_10_EXP: i32 = f64::MIN_10_EXP; /// let max = f64::MAX_10_EXP; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[deprecated(since = "TBD", note = "replaced by the `MAX_10_EXP` associated constant on `f64`")] +#[deprecated(since = "1.92.0", note = "replaced by the `MAX_10_EXP` associated constant on `f64`")] #[rustc_diagnostic_item = "f64_legacy_const_max_10_exp"] pub const MAX_10_EXP: i32 = f64::MAX_10_EXP; @@ -235,7 +238,7 @@ pub const MAX_10_EXP: i32 = f64::MAX_10_EXP; /// let nan = f64::NAN; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[deprecated(since = "TBD", note = "replaced by the `NAN` associated constant on `f64`")] +#[deprecated(since = "1.92.0", note = "replaced by the `NAN` associated constant on `f64`")] #[rustc_diagnostic_item = "f64_legacy_const_nan"] pub const NAN: f64 = f64::NAN; @@ -253,7 +256,7 @@ pub const NAN: f64 = f64::NAN; /// let inf = f64::INFINITY; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[deprecated(since = "TBD", note = "replaced by the `INFINITY` associated constant on `f64`")] +#[deprecated(since = "1.92.0", note = "replaced by the `INFINITY` associated constant on `f64`")] #[rustc_diagnostic_item = "f64_legacy_const_infinity"] pub const INFINITY: f64 = f64::INFINITY; @@ -271,7 +274,10 @@ pub const INFINITY: f64 = f64::INFINITY; /// let ninf = f64::NEG_INFINITY; /// ``` #[stable(feature = "rust1", since = "1.0.0")] -#[deprecated(since = "TBD", note = "replaced by the `NEG_INFINITY` associated constant on `f64`")] +#[deprecated( + since = "1.92.0", + note = "replaced by the `NEG_INFINITY` associated constant on `f64`" +)] #[rustc_diagnostic_item = "f64_legacy_const_neg_infinity"] pub const NEG_INFINITY: f64 = f64::NEG_INFINITY; diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs index 64a3dd3e8bc54..e0d740e3c43bf 100644 --- a/library/core/src/num/int_macros.rs +++ b/library/core/src/num/int_macros.rs @@ -3830,7 +3830,7 @@ macro_rules! int_impl { #[inline(always)] #[rustc_promotable] #[rustc_const_stable(feature = "const_min_value", since = "1.32.0")] - #[deprecated(since = "TBD", note = "replaced by the `MIN` associated constant on this type")] + #[deprecated(since = "1.92.0", note = "replaced by the `MIN` associated constant on this type")] #[rustc_diagnostic_item = concat!(stringify!($SelfT), "_legacy_fn_min_value")] pub const fn min_value() -> Self { Self::MIN @@ -3844,7 +3844,7 @@ macro_rules! int_impl { #[inline(always)] #[rustc_promotable] #[rustc_const_stable(feature = "const_max_value", since = "1.32.0")] - #[deprecated(since = "TBD", note = "replaced by the `MAX` associated constant on this type")] + #[deprecated(since = "1.92.0", note = "replaced by the `MAX` associated constant on this type")] #[rustc_diagnostic_item = concat!(stringify!($SelfT), "_legacy_fn_max_value")] pub const fn max_value() -> Self { Self::MAX diff --git a/library/core/src/num/shells/legacy_int_modules.rs b/library/core/src/num/shells/legacy_int_modules.rs index 6b4f253911157..8ed17be7b5d98 100644 --- a/library/core/src/num/shells/legacy_int_modules.rs +++ b/library/core/src/num/shells/legacy_int_modules.rs @@ -5,8 +5,8 @@ macro_rules! legacy_int_module { ($T:ident, #[$attr:meta]) => ( #[$attr] #[deprecated( - since = "TBD", - note = "all constants in this module replaced by associated constants on the type" + since = "1.92.0", + note = "all constants in this module replaced by associated constants on the type", )] #[rustc_diagnostic_item = concat!(stringify!($T), "_legacy_mod")] pub mod $T { @@ -30,7 +30,7 @@ macro_rules! legacy_int_module { /// ``` /// #[$attr] - #[deprecated(since = "TBD", note = "replaced by the `MIN` associated constant on this type")] + #[deprecated(since = "1.92.0", note = "replaced by the `MIN` associated constant on this type")] #[rustc_diagnostic_item = concat!(stringify!($T), "_legacy_const_min")] pub const MIN: $T = $T::MIN; @@ -50,7 +50,7 @@ macro_rules! legacy_int_module { /// ``` /// #[$attr] - #[deprecated(since = "TBD", note = "replaced by the `MAX` associated constant on this type")] + #[deprecated(since = "1.92.0", note = "replaced by the `MAX` associated constant on this type")] #[rustc_diagnostic_item = concat!(stringify!($T), "_legacy_const_max")] pub const MAX: $T = $T::MAX; } diff --git a/library/core/src/num/uint_macros.rs b/library/core/src/num/uint_macros.rs index bf72ec8319704..31bb37776b6e2 100644 --- a/library/core/src/num/uint_macros.rs +++ b/library/core/src/num/uint_macros.rs @@ -3852,7 +3852,7 @@ macro_rules! uint_impl { #[rustc_promotable] #[inline(always)] #[rustc_const_stable(feature = "const_max_value", since = "1.32.0")] - #[deprecated(since = "TBD", note = "replaced by the `MIN` associated constant on this type")] + #[deprecated(since = "1.92.0", note = "replaced by the `MIN` associated constant on this type")] #[rustc_diagnostic_item = concat!(stringify!($SelfT), "_legacy_fn_min_value")] pub const fn min_value() -> Self { Self::MIN } @@ -3864,7 +3864,7 @@ macro_rules! uint_impl { #[rustc_promotable] #[inline(always)] #[rustc_const_stable(feature = "const_max_value", since = "1.32.0")] - #[deprecated(since = "TBD", note = "replaced by the `MAX` associated constant on this type")] + #[deprecated(since = "1.92.0", note = "replaced by the `MAX` associated constant on this type")] #[rustc_diagnostic_item = concat!(stringify!($SelfT), "_legacy_fn_max_value")] pub const fn max_value() -> Self { Self::MAX } }