diagnostic items for legacy numeric constants
This commit is contained in:
parent
8b21296b5d
commit
d9c1c73d2c
4 changed files with 32 additions and 0 deletions
|
@ -32,6 +32,7 @@ use crate::num::FpCategory;
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[deprecated(since = "TBD", note = "replaced by the `RADIX` associated constant on `f32`")]
|
||||
#[rustc_diagnostic_item = "f32_legacy_const_radix"]
|
||||
pub const RADIX: u32 = f32::RADIX;
|
||||
|
||||
/// Number of significant digits in base 2.
|
||||
|
@ -52,6 +53,7 @@ pub const RADIX: u32 = f32::RADIX;
|
|||
since = "TBD",
|
||||
note = "replaced by the `MANTISSA_DIGITS` associated constant on `f32`"
|
||||
)]
|
||||
#[rustc_diagnostic_item = "f32_legacy_const_mantissa_dig"]
|
||||
pub const MANTISSA_DIGITS: u32 = f32::MANTISSA_DIGITS;
|
||||
|
||||
/// Approximate number of significant digits in base 10.
|
||||
|
@ -69,6 +71,7 @@ pub const MANTISSA_DIGITS: u32 = f32::MANTISSA_DIGITS;
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[deprecated(since = "TBD", note = "replaced by the `DIGITS` associated constant on `f32`")]
|
||||
#[rustc_diagnostic_item = "f32_legacy_const_digits"]
|
||||
pub const DIGITS: u32 = f32::DIGITS;
|
||||
|
||||
/// [Machine epsilon] value for `f32`.
|
||||
|
@ -90,6 +93,7 @@ pub const DIGITS: u32 = f32::DIGITS;
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[deprecated(since = "TBD", note = "replaced by the `EPSILON` associated constant on `f32`")]
|
||||
#[rustc_diagnostic_item = "f32_legacy_const_epsilon"]
|
||||
pub const EPSILON: f32 = f32::EPSILON;
|
||||
|
||||
/// Smallest finite `f32` value.
|
||||
|
@ -107,6 +111,7 @@ pub const EPSILON: f32 = f32::EPSILON;
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[deprecated(since = "TBD", note = "replaced by the `MIN` associated constant on `f32`")]
|
||||
#[rustc_diagnostic_item = "f32_legacy_const_min"]
|
||||
pub const MIN: f32 = f32::MIN;
|
||||
|
||||
/// Smallest positive normal `f32` value.
|
||||
|
@ -124,6 +129,7 @@ pub const MIN: f32 = f32::MIN;
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[deprecated(since = "TBD", 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;
|
||||
|
||||
/// Largest finite `f32` value.
|
||||
|
@ -141,6 +147,7 @@ pub const MIN_POSITIVE: f32 = f32::MIN_POSITIVE;
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[deprecated(since = "TBD", note = "replaced by the `MAX` associated constant on `f32`")]
|
||||
#[rustc_diagnostic_item = "f32_legacy_const_max"]
|
||||
pub const MAX: f32 = f32::MAX;
|
||||
|
||||
/// One greater than the minimum possible normal power of 2 exponent.
|
||||
|
@ -158,6 +165,7 @@ pub const MAX: f32 = f32::MAX;
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[deprecated(since = "TBD", 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;
|
||||
|
||||
/// Maximum possible power of 2 exponent.
|
||||
|
@ -175,6 +183,7 @@ pub const MIN_EXP: i32 = f32::MIN_EXP;
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[deprecated(since = "TBD", 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;
|
||||
|
||||
/// Minimum possible normal power of 10 exponent.
|
||||
|
@ -192,6 +201,7 @@ pub const MAX_EXP: i32 = f32::MAX_EXP;
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[deprecated(since = "TBD", 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;
|
||||
|
||||
/// Maximum possible power of 10 exponent.
|
||||
|
@ -209,6 +219,7 @@ pub const MIN_10_EXP: i32 = f32::MIN_10_EXP;
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[deprecated(since = "TBD", 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;
|
||||
|
||||
/// Not a Number (NaN).
|
||||
|
@ -226,6 +237,7 @@ pub const MAX_10_EXP: i32 = f32::MAX_10_EXP;
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[deprecated(since = "TBD", note = "replaced by the `NAN` associated constant on `f32`")]
|
||||
#[rustc_diagnostic_item = "f32_legacy_const_nan"]
|
||||
pub const NAN: f32 = f32::NAN;
|
||||
|
||||
/// Infinity (∞).
|
||||
|
@ -243,6 +255,7 @@ pub const NAN: f32 = f32::NAN;
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[deprecated(since = "TBD", note = "replaced by the `INFINITY` associated constant on `f32`")]
|
||||
#[rustc_diagnostic_item = "f32_legacy_const_infinity"]
|
||||
pub const INFINITY: f32 = f32::INFINITY;
|
||||
|
||||
/// Negative infinity (−∞).
|
||||
|
@ -260,6 +273,7 @@ pub const INFINITY: f32 = f32::INFINITY;
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[deprecated(since = "TBD", 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;
|
||||
|
||||
/// Basic mathematical constants.
|
||||
|
|
|
@ -32,6 +32,7 @@ use crate::num::FpCategory;
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[deprecated(since = "TBD", note = "replaced by the `RADIX` associated constant on `f64`")]
|
||||
#[rustc_diagnostic_item = "f64_legacy_const_radix"]
|
||||
pub const RADIX: u32 = f64::RADIX;
|
||||
|
||||
/// Number of significant digits in base 2.
|
||||
|
@ -52,6 +53,7 @@ pub const RADIX: u32 = f64::RADIX;
|
|||
since = "TBD",
|
||||
note = "replaced by the `MANTISSA_DIGITS` associated constant on `f64`"
|
||||
)]
|
||||
#[rustc_diagnostic_item = "f64_legacy_const_mantissa_dig"]
|
||||
pub const MANTISSA_DIGITS: u32 = f64::MANTISSA_DIGITS;
|
||||
|
||||
/// Approximate number of significant digits in base 10.
|
||||
|
@ -69,6 +71,7 @@ pub const MANTISSA_DIGITS: u32 = f64::MANTISSA_DIGITS;
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[deprecated(since = "TBD", note = "replaced by the `DIGITS` associated constant on `f64`")]
|
||||
#[rustc_diagnostic_item = "f64_legacy_const_digits"]
|
||||
pub const DIGITS: u32 = f64::DIGITS;
|
||||
|
||||
/// [Machine epsilon] value for `f64`.
|
||||
|
@ -90,6 +93,7 @@ pub const DIGITS: u32 = f64::DIGITS;
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[deprecated(since = "TBD", note = "replaced by the `EPSILON` associated constant on `f64`")]
|
||||
#[rustc_diagnostic_item = "f64_legacy_const_epsilon"]
|
||||
pub const EPSILON: f64 = f64::EPSILON;
|
||||
|
||||
/// Smallest finite `f64` value.
|
||||
|
@ -107,6 +111,7 @@ pub const EPSILON: f64 = f64::EPSILON;
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[deprecated(since = "TBD", note = "replaced by the `MIN` associated constant on `f64`")]
|
||||
#[rustc_diagnostic_item = "f64_legacy_const_min"]
|
||||
pub const MIN: f64 = f64::MIN;
|
||||
|
||||
/// Smallest positive normal `f64` value.
|
||||
|
@ -124,6 +129,7 @@ pub const MIN: f64 = f64::MIN;
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[deprecated(since = "TBD", 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;
|
||||
|
||||
/// Largest finite `f64` value.
|
||||
|
@ -141,6 +147,7 @@ pub const MIN_POSITIVE: f64 = f64::MIN_POSITIVE;
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[deprecated(since = "TBD", note = "replaced by the `MAX` associated constant on `f64`")]
|
||||
#[rustc_diagnostic_item = "f64_legacy_const_max"]
|
||||
pub const MAX: f64 = f64::MAX;
|
||||
|
||||
/// One greater than the minimum possible normal power of 2 exponent.
|
||||
|
@ -158,6 +165,7 @@ pub const MAX: f64 = f64::MAX;
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[deprecated(since = "TBD", 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;
|
||||
|
||||
/// Maximum possible power of 2 exponent.
|
||||
|
@ -175,6 +183,7 @@ pub const MIN_EXP: i32 = f64::MIN_EXP;
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[deprecated(since = "TBD", 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;
|
||||
|
||||
/// Minimum possible normal power of 10 exponent.
|
||||
|
@ -192,6 +201,7 @@ pub const MAX_EXP: i32 = f64::MAX_EXP;
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[deprecated(since = "TBD", 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;
|
||||
|
||||
/// Maximum possible power of 10 exponent.
|
||||
|
@ -209,6 +219,7 @@ pub const MIN_10_EXP: i32 = f64::MIN_10_EXP;
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[deprecated(since = "TBD", 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;
|
||||
|
||||
/// Not a Number (NaN).
|
||||
|
@ -226,6 +237,7 @@ pub const MAX_10_EXP: i32 = f64::MAX_10_EXP;
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[deprecated(since = "TBD", note = "replaced by the `NAN` associated constant on `f64`")]
|
||||
#[rustc_diagnostic_item = "f64_legacy_const_nan"]
|
||||
pub const NAN: f64 = f64::NAN;
|
||||
|
||||
/// Infinity (∞).
|
||||
|
@ -243,6 +255,7 @@ pub const NAN: f64 = f64::NAN;
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[deprecated(since = "TBD", note = "replaced by the `INFINITY` associated constant on `f64`")]
|
||||
#[rustc_diagnostic_item = "f64_legacy_const_infinity"]
|
||||
pub const INFINITY: f64 = f64::INFINITY;
|
||||
|
||||
/// Negative infinity (−∞).
|
||||
|
@ -260,6 +273,7 @@ pub const INFINITY: f64 = f64::INFINITY;
|
|||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[deprecated(since = "TBD", 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;
|
||||
|
||||
/// Basic mathematical constants.
|
||||
|
|
|
@ -3507,6 +3507,7 @@ macro_rules! int_impl {
|
|||
#[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")]
|
||||
#[rustc_diagnostic_item = concat!(stringify!($SelfT), "_legacy_fn_min_value")]
|
||||
pub const fn min_value() -> Self {
|
||||
Self::MIN
|
||||
}
|
||||
|
@ -3520,6 +3521,7 @@ macro_rules! int_impl {
|
|||
#[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")]
|
||||
#[rustc_diagnostic_item = concat!(stringify!($SelfT), "_legacy_fn_max_value")]
|
||||
pub const fn max_value() -> Self {
|
||||
Self::MAX
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ macro_rules! int_module {
|
|||
///
|
||||
#[$attr]
|
||||
#[deprecated(since = "TBD", 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;
|
||||
|
||||
#[doc = concat!(
|
||||
|
@ -39,6 +40,7 @@ macro_rules! int_module {
|
|||
///
|
||||
#[$attr]
|
||||
#[deprecated(since = "TBD", 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;
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue