Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark std integral modules as deprecated (std::u32, std::i16, etc.) #107587

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions library/core/src/num/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use crate::num::FpCategory;
/// 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.69.0", note = "replaced by the `RADIX` associated constant on `f32`")]
pub const RADIX: u32 = f32::RADIX;

/// Number of significant digits in base 2.
Expand All @@ -49,7 +49,7 @@ pub const RADIX: u32 = f32::RADIX;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[deprecated(
since = "TBD",
since = "1.69.0",
note = "replaced by the `MANTISSA_DIGITS` associated constant on `f32`"
)]
pub const MANTISSA_DIGITS: u32 = f32::MANTISSA_DIGITS;
Expand All @@ -68,7 +68,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.69.0", note = "replaced by the `DIGITS` associated constant on `f32`")]
pub const DIGITS: u32 = f32::DIGITS;

/// [Machine epsilon] value for `f32`.
Expand All @@ -89,7 +89,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.69.0", note = "replaced by the `EPSILON` associated constant on `f32`")]
pub const EPSILON: f32 = f32::EPSILON;

/// Smallest finite `f32` value.
Expand All @@ -106,7 +106,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.69.0", note = "replaced by the `MIN` associated constant on `f32`")]
pub const MIN: f32 = f32::MIN;

/// Smallest positive normal `f32` value.
Expand All @@ -123,7 +123,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.69.0",
note = "replaced by the `MIN_POSITIVE` associated constant on `f32`"
)]
pub const MIN_POSITIVE: f32 = f32::MIN_POSITIVE;

/// Largest finite `f32` value.
Expand All @@ -140,7 +143,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.69.0", note = "replaced by the `MAX` associated constant on `f32`")]
pub const MAX: f32 = f32::MAX;

/// One greater than the minimum possible normal power of 2 exponent.
Expand All @@ -157,7 +160,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.69.0", note = "replaced by the `MIN_EXP` associated constant on `f32`")]
pub const MIN_EXP: i32 = f32::MIN_EXP;

/// Maximum possible power of 2 exponent.
Expand All @@ -174,7 +177,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.69.0", note = "replaced by the `MAX_EXP` associated constant on `f32`")]
pub const MAX_EXP: i32 = f32::MAX_EXP;

/// Minimum possible normal power of 10 exponent.
Expand All @@ -191,7 +194,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.69.0", note = "replaced by the `MIN_10_EXP` associated constant on `f32`")]
pub const MIN_10_EXP: i32 = f32::MIN_10_EXP;

/// Maximum possible power of 10 exponent.
Expand All @@ -208,7 +211,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.69.0", note = "replaced by the `MAX_10_EXP` associated constant on `f32`")]
pub const MAX_10_EXP: i32 = f32::MAX_10_EXP;

/// Not a Number (NaN).
Expand All @@ -225,7 +228,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.69.0", note = "replaced by the `NAN` associated constant on `f32`")]
pub const NAN: f32 = f32::NAN;

/// Infinity (∞).
Expand All @@ -242,7 +245,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.69.0", note = "replaced by the `INFINITY` associated constant on `f32`")]
pub const INFINITY: f32 = f32::INFINITY;

/// Negative infinity (−∞).
Expand All @@ -259,7 +262,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.69.0",
note = "replaced by the `NEG_INFINITY` associated constant on `f32`"
)]
pub const NEG_INFINITY: f32 = f32::NEG_INFINITY;

/// Basic mathematical constants.
Expand Down
34 changes: 20 additions & 14 deletions library/core/src/num/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use crate::num::FpCategory;
/// 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.69.0", note = "replaced by the `RADIX` associated constant on `f64`")]
pub const RADIX: u32 = f64::RADIX;

/// Number of significant digits in base 2.
Expand All @@ -49,7 +49,7 @@ pub const RADIX: u32 = f64::RADIX;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[deprecated(
since = "TBD",
since = "1.69.0",
note = "replaced by the `MANTISSA_DIGITS` associated constant on `f64`"
)]
pub const MANTISSA_DIGITS: u32 = f64::MANTISSA_DIGITS;
Expand All @@ -68,7 +68,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.69.0", note = "replaced by the `DIGITS` associated constant on `f64`")]
pub const DIGITS: u32 = f64::DIGITS;

/// [Machine epsilon] value for `f64`.
Expand All @@ -89,7 +89,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.69.0", note = "replaced by the `EPSILON` associated constant on `f64`")]
pub const EPSILON: f64 = f64::EPSILON;

/// Smallest finite `f64` value.
Expand All @@ -106,7 +106,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.69.0", note = "replaced by the `MIN` associated constant on `f64`")]
pub const MIN: f64 = f64::MIN;

/// Smallest positive normal `f64` value.
Expand All @@ -123,7 +123,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.69.0",
note = "replaced by the `MIN_POSITIVE` associated constant on `f64`"
)]
pub const MIN_POSITIVE: f64 = f64::MIN_POSITIVE;

/// Largest finite `f64` value.
Expand All @@ -140,7 +143,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.69.0", note = "replaced by the `MAX` associated constant on `f64`")]
pub const MAX: f64 = f64::MAX;

/// One greater than the minimum possible normal power of 2 exponent.
Expand All @@ -157,7 +160,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.69.0", note = "replaced by the `MIN_EXP` associated constant on `f64`")]
pub const MIN_EXP: i32 = f64::MIN_EXP;

/// Maximum possible power of 2 exponent.
Expand All @@ -174,7 +177,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.69.0", note = "replaced by the `MAX_EXP` associated constant on `f64`")]
pub const MAX_EXP: i32 = f64::MAX_EXP;

/// Minimum possible normal power of 10 exponent.
Expand All @@ -191,7 +194,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.69.0", note = "replaced by the `MIN_10_EXP` associated constant on `f64`")]
pub const MIN_10_EXP: i32 = f64::MIN_10_EXP;

/// Maximum possible power of 10 exponent.
Expand All @@ -208,7 +211,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.69.0", note = "replaced by the `MAX_10_EXP` associated constant on `f64`")]
pub const MAX_10_EXP: i32 = f64::MAX_10_EXP;

/// Not a Number (NaN).
Expand All @@ -225,7 +228,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.69.0", note = "replaced by the `NAN` associated constant on `f64`")]
pub const NAN: f64 = f64::NAN;

/// Infinity (∞).
Expand All @@ -242,7 +245,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.69.0", note = "replaced by the `INFINITY` associated constant on `f64`")]
pub const INFINITY: f64 = f64::INFINITY;

/// Negative infinity (−∞).
Expand All @@ -259,7 +262,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.69.0",
note = "replaced by the `NEG_INFINITY` associated constant on `f64`"
)]
pub const NEG_INFINITY: f64 = f64::NEG_INFINITY;

/// Basic mathematical constants.
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/num/shells/i128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#![stable(feature = "i128", since = "1.26.0")]
#![deprecated(
since = "TBD",
since = "1.69.0",
note = "all constants in this module replaced by associated constants on `i128`"
)]

Expand Down
2 changes: 1 addition & 1 deletion library/core/src/num/shells/i16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#![stable(feature = "rust1", since = "1.0.0")]
#![deprecated(
since = "TBD",
since = "1.69.0",
note = "all constants in this module replaced by associated constants on `i16`"
)]

Expand Down
2 changes: 1 addition & 1 deletion library/core/src/num/shells/i32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#![stable(feature = "rust1", since = "1.0.0")]
#![deprecated(
since = "TBD",
since = "1.69.0",
note = "all constants in this module replaced by associated constants on `i32`"
)]

Expand Down
2 changes: 1 addition & 1 deletion library/core/src/num/shells/i64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#![stable(feature = "rust1", since = "1.0.0")]
#![deprecated(
since = "TBD",
since = "1.69.0",
note = "all constants in this module replaced by associated constants on `i64`"
)]

Expand Down
2 changes: 1 addition & 1 deletion library/core/src/num/shells/i8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#![stable(feature = "rust1", since = "1.0.0")]
#![deprecated(
since = "TBD",
since = "1.69.0",
note = "all constants in this module replaced by associated constants on `i8`"
)]

Expand Down
4 changes: 2 additions & 2 deletions library/core/src/num/shells/int_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ macro_rules! int_module {
/// ```
///
#[$attr]
#[deprecated(since = "TBD", note = "replaced by the `MIN` associated constant on this type")]
#[deprecated(since = "1.69.0", note = "replaced by the `MIN` associated constant on this type")]
pub const MIN: $T = $T::MIN;

#[doc = concat!(
Expand All @@ -38,7 +38,7 @@ macro_rules! int_module {
/// ```
///
#[$attr]
#[deprecated(since = "TBD", note = "replaced by the `MAX` associated constant on this type")]
#[deprecated(since = "1.69.0", note = "replaced by the `MAX` associated constant on this type")]
pub const MAX: $T = $T::MAX;
)
}
2 changes: 1 addition & 1 deletion library/core/src/num/shells/isize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#![stable(feature = "rust1", since = "1.0.0")]
#![deprecated(
since = "TBD",
since = "1.69.0",
note = "all constants in this module replaced by associated constants on `isize`"
)]

Expand Down
2 changes: 1 addition & 1 deletion library/core/src/num/shells/u128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#![stable(feature = "i128", since = "1.26.0")]
#![deprecated(
since = "TBD",
since = "1.69.0",
note = "all constants in this module replaced by associated constants on `u128`"
)]

Expand Down
2 changes: 1 addition & 1 deletion library/core/src/num/shells/u16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#![stable(feature = "rust1", since = "1.0.0")]
#![deprecated(
since = "TBD",
since = "1.69.0",
note = "all constants in this module replaced by associated constants on `u16`"
)]

Expand Down
2 changes: 1 addition & 1 deletion library/core/src/num/shells/u32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#![stable(feature = "rust1", since = "1.0.0")]
#![deprecated(
since = "TBD",
since = "1.69.0",
note = "all constants in this module replaced by associated constants on `u32`"
)]

Expand Down
2 changes: 1 addition & 1 deletion library/core/src/num/shells/u64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#![stable(feature = "rust1", since = "1.0.0")]
#![deprecated(
since = "TBD",
since = "1.69.0",
note = "all constants in this module replaced by associated constants on `u64`"
)]

Expand Down
2 changes: 1 addition & 1 deletion library/core/src/num/shells/u8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#![stable(feature = "rust1", since = "1.0.0")]
#![deprecated(
since = "TBD",
since = "1.69.0",
note = "all constants in this module replaced by associated constants on `u8`"
)]

Expand Down
2 changes: 1 addition & 1 deletion library/core/src/num/shells/usize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#![stable(feature = "rust1", since = "1.0.0")]
#![deprecated(
since = "TBD",
since = "1.69.0",
note = "all constants in this module replaced by associated constants on `usize`"
)]

Expand Down