1
Fork 0

Auto merge of #95960 - jhpratt:remove-rustc_deprecated, r=compiler-errors

Remove `#[rustc_deprecated]`

This removes `#[rustc_deprecated]` and introduces diagnostics to help users to the right direction (that being `#[deprecated]`). All uses of `#[rustc_deprecated]` have been converted. CI is expected to fail initially; this requires #95958, which includes converting `stdarch`.

I plan on following up in a short while (maybe a bootstrap cycle?) removing the diagnostics, as they're only intended to be short-term.
This commit is contained in:
bors 2022-05-09 04:47:30 +00:00
commit 8a2fe75d0e
98 changed files with 406 additions and 437 deletions

View file

@ -419,9 +419,9 @@ impl Layout {
}
#[stable(feature = "alloc_layout", since = "1.28.0")]
#[rustc_deprecated(
#[deprecated(
since = "1.52.0",
reason = "Name does not follow std convention, use LayoutError",
note = "Name does not follow std convention, use LayoutError",
suggestion = "LayoutError"
)]
pub type LayoutErr = LayoutError;

View file

@ -10,9 +10,9 @@ pub use self::global::GlobalAlloc;
#[stable(feature = "alloc_layout", since = "1.28.0")]
pub use self::layout::Layout;
#[stable(feature = "alloc_layout", since = "1.28.0")]
#[rustc_deprecated(
#[deprecated(
since = "1.52.0",
reason = "Name does not follow std convention, use LayoutError",
note = "Name does not follow std convention, use LayoutError",
suggestion = "LayoutError"
)]
#[allow(deprecated, deprecated_in_future)]

View file

@ -79,7 +79,7 @@ impl<T, const N: usize> IntoIterator for [T; N] {
impl<T, const N: usize> IntoIter<T, N> {
/// Creates a new iterator over the given `array`.
#[stable(feature = "array_value_iter", since = "1.51.0")]
#[rustc_deprecated(since = "1.59.0", reason = "use `IntoIterator::into_iter` instead")]
#[deprecated(since = "1.59.0", note = "use `IntoIterator::into_iter` instead")]
pub fn new(array: [T; N]) -> Self {
IntoIterator::into_iter(array)
}

View file

@ -1653,10 +1653,10 @@ impl<'a> Formatter<'a> {
/// Flags for formatting
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
#[deprecated(
since = "1.24.0",
reason = "use the `sign_plus`, `sign_minus`, `alternate`, \
or `sign_aware_zero_pad` methods instead"
note = "use the `sign_plus`, `sign_minus`, `alternate`, \
or `sign_aware_zero_pad` methods instead"
)]
pub fn flags(&self) -> u32 {
self.flags

View file

@ -14,10 +14,7 @@ use crate::ptr;
///
/// See: <https://131002.net/siphash>
#[unstable(feature = "hashmap_internals", issue = "none")]
#[rustc_deprecated(
since = "1.13.0",
reason = "use `std::collections::hash_map::DefaultHasher` instead"
)]
#[deprecated(since = "1.13.0", note = "use `std::collections::hash_map::DefaultHasher` instead")]
#[derive(Debug, Clone, Default)]
#[doc(hidden)]
pub struct SipHasher13 {
@ -28,10 +25,7 @@ pub struct SipHasher13 {
///
/// See: <https://131002.net/siphash/>
#[unstable(feature = "hashmap_internals", issue = "none")]
#[rustc_deprecated(
since = "1.13.0",
reason = "use `std::collections::hash_map::DefaultHasher` instead"
)]
#[deprecated(since = "1.13.0", note = "use `std::collections::hash_map::DefaultHasher` instead")]
#[derive(Debug, Clone, Default)]
struct SipHasher24 {
hasher: Hasher<Sip24Rounds>,
@ -50,10 +44,7 @@ struct SipHasher24 {
/// it is not intended for cryptographic purposes. As such, all
/// cryptographic uses of this implementation are _strongly discouraged_.
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
since = "1.13.0",
reason = "use `std::collections::hash_map::DefaultHasher` instead"
)]
#[deprecated(since = "1.13.0", note = "use `std::collections::hash_map::DefaultHasher` instead")]
#[derive(Debug, Clone, Default)]
pub struct SipHasher(SipHasher24);
@ -153,9 +144,9 @@ impl SipHasher {
/// Creates a new `SipHasher` with the two initial keys set to 0.
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
#[deprecated(
since = "1.13.0",
reason = "use `std::collections::hash_map::DefaultHasher` instead"
note = "use `std::collections::hash_map::DefaultHasher` instead"
)]
#[must_use]
pub fn new() -> SipHasher {
@ -165,9 +156,9 @@ impl SipHasher {
/// Creates a `SipHasher` that is keyed off the provided keys.
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
#[deprecated(
since = "1.13.0",
reason = "use `std::collections::hash_map::DefaultHasher` instead"
note = "use `std::collections::hash_map::DefaultHasher` instead"
)]
#[must_use]
pub fn new_with_keys(key0: u64, key1: u64) -> SipHasher {
@ -179,9 +170,9 @@ impl SipHasher13 {
/// Creates a new `SipHasher13` with the two initial keys set to 0.
#[inline]
#[unstable(feature = "hashmap_internals", issue = "none")]
#[rustc_deprecated(
#[deprecated(
since = "1.13.0",
reason = "use `std::collections::hash_map::DefaultHasher` instead"
note = "use `std::collections::hash_map::DefaultHasher` instead"
)]
pub fn new() -> SipHasher13 {
SipHasher13::new_with_keys(0, 0)
@ -190,9 +181,9 @@ impl SipHasher13 {
/// Creates a `SipHasher13` that is keyed off the provided keys.
#[inline]
#[unstable(feature = "hashmap_internals", issue = "none")]
#[rustc_deprecated(
#[deprecated(
since = "1.13.0",
reason = "use `std::collections::hash_map::DefaultHasher` instead"
note = "use `std::collections::hash_map::DefaultHasher` instead"
)]
pub fn new_with_keys(key0: u64, key1: u64) -> SipHasher13 {
SipHasher13 { hasher: Hasher::new_with_keys(key0, key1) }

View file

@ -63,10 +63,7 @@ use crate::mem;
use crate::sync::atomic::{self, AtomicBool, AtomicI32, AtomicIsize, AtomicU32, Ordering};
#[stable(feature = "drop_in_place", since = "1.8.0")]
#[rustc_deprecated(
reason = "no longer an intrinsic - use `ptr::drop_in_place` directly",
since = "1.52.0"
)]
#[deprecated(note = "no longer an intrinsic - use `ptr::drop_in_place` directly", since = "1.52.0")]
#[inline]
pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
// SAFETY: see `ptr::drop_in_place`

View file

@ -410,7 +410,7 @@ macro_rules! matches {
/// ```
#[macro_export]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(since = "1.39.0", reason = "use the `?` operator instead")]
#[deprecated(since = "1.39.0", note = "use the `?` operator instead")]
#[doc(alias = "?")]
macro_rules! r#try {
($expr:expr $(,)?) => {
@ -1536,10 +1536,7 @@ pub(crate) mod builtin {
#[rustc_builtin_macro]
#[stable(feature = "rust1", since = "1.0.0")]
#[allow_internal_unstable(core_intrinsics, libstd_sys_internals)]
#[rustc_deprecated(
since = "1.52.0",
reason = "rustc-serialize is deprecated and no longer supported"
)]
#[deprecated(since = "1.52.0", note = "rustc-serialize is deprecated and no longer supported")]
#[doc(hidden)] // While technically stable, using it is unstable, and deprecated. Hide it.
pub macro RustcDecodable($item:item) {
/* compiler built-in */
@ -1549,10 +1546,7 @@ pub(crate) mod builtin {
#[rustc_builtin_macro]
#[stable(feature = "rust1", since = "1.0.0")]
#[allow_internal_unstable(core_intrinsics)]
#[rustc_deprecated(
since = "1.52.0",
reason = "rustc-serialize is deprecated and no longer supported"
)]
#[deprecated(since = "1.52.0", note = "rustc-serialize is deprecated and no longer supported")]
#[doc(hidden)] // While technically stable, using it is unstable, and deprecated. Hide it.
pub macro RustcEncodable($item:item) {
/* compiler built-in */

View file

@ -408,7 +408,7 @@ pub const unsafe fn size_of_val_raw<T: ?Sized>(val: *const T) -> usize {
#[inline]
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(reason = "use `align_of` instead", since = "1.2.0")]
#[deprecated(note = "use `align_of` instead", since = "1.2.0")]
pub fn min_align_of<T>() -> usize {
intrinsics::min_align_of::<T>()
}
@ -431,7 +431,7 @@ pub fn min_align_of<T>() -> usize {
#[inline]
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(reason = "use `align_of_val` instead", since = "1.2.0")]
#[deprecated(note = "use `align_of_val` instead", since = "1.2.0")]
pub fn min_align_of_val<T: ?Sized>(val: &T) -> usize {
// SAFETY: val is a reference, so it's a valid raw pointer
unsafe { intrinsics::min_align_of_val(val) }
@ -673,7 +673,7 @@ pub unsafe fn zeroed<T>() -> T {
/// [inv]: MaybeUninit#initialization-invariant
#[inline(always)]
#[must_use]
#[rustc_deprecated(since = "1.39.0", reason = "use `mem::MaybeUninit` instead")]
#[deprecated(since = "1.39.0", note = "use `mem::MaybeUninit` instead")]
#[stable(feature = "rust1", since = "1.0.0")]
#[allow(deprecated_in_future)]
#[allow(deprecated)]

View file

@ -31,7 +31,7 @@ use crate::num::FpCategory;
/// let r = f32::RADIX;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(since = "TBD", reason = "replaced by the `RADIX` associated constant on `f32`")]
#[deprecated(since = "TBD", note = "replaced by the `RADIX` associated constant on `f32`")]
pub const RADIX: u32 = f32::RADIX;
/// Number of significant digits in base 2.
@ -48,9 +48,9 @@ pub const RADIX: u32 = f32::RADIX;
/// let d = f32::MANTISSA_DIGITS;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
#[deprecated(
since = "TBD",
reason = "replaced by the `MANTISSA_DIGITS` associated constant on `f32`"
note = "replaced by the `MANTISSA_DIGITS` associated constant on `f32`"
)]
pub const MANTISSA_DIGITS: u32 = f32::MANTISSA_DIGITS;
@ -68,7 +68,7 @@ pub const MANTISSA_DIGITS: u32 = f32::MANTISSA_DIGITS;
/// let d = f32::DIGITS;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(since = "TBD", reason = "replaced by the `DIGITS` associated constant on `f32`")]
#[deprecated(since = "TBD", note = "replaced by the `DIGITS` associated constant on `f32`")]
pub const DIGITS: u32 = f32::DIGITS;
/// [Machine epsilon] value for `f32`.
@ -89,10 +89,7 @@ pub const DIGITS: u32 = f32::DIGITS;
/// let e = f32::EPSILON;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
since = "TBD",
reason = "replaced by the `EPSILON` associated constant on `f32`"
)]
#[deprecated(since = "TBD", note = "replaced by the `EPSILON` associated constant on `f32`")]
pub const EPSILON: f32 = f32::EPSILON;
/// Smallest finite `f32` value.
@ -109,7 +106,7 @@ pub const EPSILON: f32 = f32::EPSILON;
/// let min = f32::MIN;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(since = "TBD", reason = "replaced by the `MIN` associated constant on `f32`")]
#[deprecated(since = "TBD", note = "replaced by the `MIN` associated constant on `f32`")]
pub const MIN: f32 = f32::MIN;
/// Smallest positive normal `f32` value.
@ -126,10 +123,7 @@ pub const MIN: f32 = f32::MIN;
/// let min = f32::MIN_POSITIVE;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
since = "TBD",
reason = "replaced by the `MIN_POSITIVE` associated constant on `f32`"
)]
#[deprecated(since = "TBD", note = "replaced by the `MIN_POSITIVE` associated constant on `f32`")]
pub const MIN_POSITIVE: f32 = f32::MIN_POSITIVE;
/// Largest finite `f32` value.
@ -146,7 +140,7 @@ pub const MIN_POSITIVE: f32 = f32::MIN_POSITIVE;
/// let max = f32::MAX;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(since = "TBD", reason = "replaced by the `MAX` associated constant on `f32`")]
#[deprecated(since = "TBD", 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.
@ -163,10 +157,7 @@ pub const MAX: f32 = f32::MAX;
/// let min = f32::MIN_EXP;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
since = "TBD",
reason = "replaced by the `MIN_EXP` associated constant on `f32`"
)]
#[deprecated(since = "TBD", note = "replaced by the `MIN_EXP` associated constant on `f32`")]
pub const MIN_EXP: i32 = f32::MIN_EXP;
/// Maximum possible power of 2 exponent.
@ -183,10 +174,7 @@ pub const MIN_EXP: i32 = f32::MIN_EXP;
/// let max = f32::MAX_EXP;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
since = "TBD",
reason = "replaced by the `MAX_EXP` associated constant on `f32`"
)]
#[deprecated(since = "TBD", 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.
@ -203,10 +191,7 @@ pub const MAX_EXP: i32 = f32::MAX_EXP;
/// let min = f32::MIN_10_EXP;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
since = "TBD",
reason = "replaced by the `MIN_10_EXP` associated constant on `f32`"
)]
#[deprecated(since = "TBD", 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.
@ -223,10 +208,7 @@ pub const MIN_10_EXP: i32 = f32::MIN_10_EXP;
/// let max = f32::MAX_10_EXP;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
since = "TBD",
reason = "replaced by the `MAX_10_EXP` associated constant on `f32`"
)]
#[deprecated(since = "TBD", 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).
@ -243,7 +225,7 @@ pub const MAX_10_EXP: i32 = f32::MAX_10_EXP;
/// let nan = f32::NAN;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(since = "TBD", reason = "replaced by the `NAN` associated constant on `f32`")]
#[deprecated(since = "TBD", note = "replaced by the `NAN` associated constant on `f32`")]
pub const NAN: f32 = f32::NAN;
/// Infinity (∞).
@ -260,10 +242,7 @@ pub const NAN: f32 = f32::NAN;
/// let inf = f32::INFINITY;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
since = "TBD",
reason = "replaced by the `INFINITY` associated constant on `f32`"
)]
#[deprecated(since = "TBD", note = "replaced by the `INFINITY` associated constant on `f32`")]
pub const INFINITY: f32 = f32::INFINITY;
/// Negative infinity (−∞).
@ -280,10 +259,7 @@ pub const INFINITY: f32 = f32::INFINITY;
/// let ninf = f32::NEG_INFINITY;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
since = "TBD",
reason = "replaced by the `NEG_INFINITY` associated constant on `f32`"
)]
#[deprecated(since = "TBD", note = "replaced by the `NEG_INFINITY` associated constant on `f32`")]
pub const NEG_INFINITY: f32 = f32::NEG_INFINITY;
/// Basic mathematical constants.

View file

@ -31,7 +31,7 @@ use crate::num::FpCategory;
/// let r = f64::RADIX;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(since = "TBD", reason = "replaced by the `RADIX` associated constant on `f64`")]
#[deprecated(since = "TBD", note = "replaced by the `RADIX` associated constant on `f64`")]
pub const RADIX: u32 = f64::RADIX;
/// Number of significant digits in base 2.
@ -48,9 +48,9 @@ pub const RADIX: u32 = f64::RADIX;
/// let d = f64::MANTISSA_DIGITS;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
#[deprecated(
since = "TBD",
reason = "replaced by the `MANTISSA_DIGITS` associated constant on `f64`"
note = "replaced by the `MANTISSA_DIGITS` associated constant on `f64`"
)]
pub const MANTISSA_DIGITS: u32 = f64::MANTISSA_DIGITS;
@ -68,7 +68,7 @@ pub const MANTISSA_DIGITS: u32 = f64::MANTISSA_DIGITS;
/// let d = f64::DIGITS;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(since = "TBD", reason = "replaced by the `DIGITS` associated constant on `f64`")]
#[deprecated(since = "TBD", note = "replaced by the `DIGITS` associated constant on `f64`")]
pub const DIGITS: u32 = f64::DIGITS;
/// [Machine epsilon] value for `f64`.
@ -89,10 +89,7 @@ pub const DIGITS: u32 = f64::DIGITS;
/// let e = f64::EPSILON;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
since = "TBD",
reason = "replaced by the `EPSILON` associated constant on `f64`"
)]
#[deprecated(since = "TBD", note = "replaced by the `EPSILON` associated constant on `f64`")]
pub const EPSILON: f64 = f64::EPSILON;
/// Smallest finite `f64` value.
@ -109,7 +106,7 @@ pub const EPSILON: f64 = f64::EPSILON;
/// let min = f64::MIN;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(since = "TBD", reason = "replaced by the `MIN` associated constant on `f64`")]
#[deprecated(since = "TBD", note = "replaced by the `MIN` associated constant on `f64`")]
pub const MIN: f64 = f64::MIN;
/// Smallest positive normal `f64` value.
@ -126,10 +123,7 @@ pub const MIN: f64 = f64::MIN;
/// let min = f64::MIN_POSITIVE;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
since = "TBD",
reason = "replaced by the `MIN_POSITIVE` associated constant on `f64`"
)]
#[deprecated(since = "TBD", note = "replaced by the `MIN_POSITIVE` associated constant on `f64`")]
pub const MIN_POSITIVE: f64 = f64::MIN_POSITIVE;
/// Largest finite `f64` value.
@ -146,7 +140,7 @@ pub const MIN_POSITIVE: f64 = f64::MIN_POSITIVE;
/// let max = f64::MAX;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(since = "TBD", reason = "replaced by the `MAX` associated constant on `f64`")]
#[deprecated(since = "TBD", 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.
@ -163,10 +157,7 @@ pub const MAX: f64 = f64::MAX;
/// let min = f64::MIN_EXP;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
since = "TBD",
reason = "replaced by the `MIN_EXP` associated constant on `f64`"
)]
#[deprecated(since = "TBD", note = "replaced by the `MIN_EXP` associated constant on `f64`")]
pub const MIN_EXP: i32 = f64::MIN_EXP;
/// Maximum possible power of 2 exponent.
@ -183,10 +174,7 @@ pub const MIN_EXP: i32 = f64::MIN_EXP;
/// let max = f64::MAX_EXP;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
since = "TBD",
reason = "replaced by the `MAX_EXP` associated constant on `f64`"
)]
#[deprecated(since = "TBD", 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.
@ -203,10 +191,7 @@ pub const MAX_EXP: i32 = f64::MAX_EXP;
/// let min = f64::MIN_10_EXP;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
since = "TBD",
reason = "replaced by the `MIN_10_EXP` associated constant on `f64`"
)]
#[deprecated(since = "TBD", 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.
@ -223,10 +208,7 @@ pub const MIN_10_EXP: i32 = f64::MIN_10_EXP;
/// let max = f64::MAX_10_EXP;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
since = "TBD",
reason = "replaced by the `MAX_10_EXP` associated constant on `f64`"
)]
#[deprecated(since = "TBD", 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).
@ -243,7 +225,7 @@ pub const MAX_10_EXP: i32 = f64::MAX_10_EXP;
/// let nan = f64::NAN;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(since = "TBD", reason = "replaced by the `NAN` associated constant on `f64`")]
#[deprecated(since = "TBD", note = "replaced by the `NAN` associated constant on `f64`")]
pub const NAN: f64 = f64::NAN;
/// Infinity (∞).
@ -260,10 +242,7 @@ pub const NAN: f64 = f64::NAN;
/// let inf = f64::INFINITY;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
since = "TBD",
reason = "replaced by the `INFINITY` associated constant on `f64`"
)]
#[deprecated(since = "TBD", note = "replaced by the `INFINITY` associated constant on `f64`")]
pub const INFINITY: f64 = f64::INFINITY;
/// Negative infinity (−∞).
@ -280,10 +259,7 @@ pub const INFINITY: f64 = f64::INFINITY;
/// let ninf = f64::NEG_INFINITY;
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
since = "TBD",
reason = "replaced by the `NEG_INFINITY` associated constant on `f64`"
)]
#[deprecated(since = "TBD", note = "replaced by the `NEG_INFINITY` associated constant on `f64`")]
pub const NEG_INFINITY: f64 = f64::NEG_INFINITY;
/// Basic mathematical constants.
@ -658,7 +634,7 @@ impl f64 {
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(since = "1.0.0", reason = "renamed to is_sign_positive")]
#[deprecated(since = "1.0.0", note = "renamed to is_sign_positive")]
#[inline]
#[doc(hidden)]
pub fn is_positive(self) -> bool {
@ -688,7 +664,7 @@ impl f64 {
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(since = "1.0.0", reason = "renamed to is_sign_negative")]
#[deprecated(since = "1.0.0", note = "renamed to is_sign_negative")]
#[inline]
#[doc(hidden)]
pub fn is_negative(self) -> bool {

View file

@ -2717,7 +2717,7 @@ macro_rules! int_impl {
#[inline(always)]
#[rustc_promotable]
#[rustc_const_stable(feature = "const_min_value", since = "1.32.0")]
#[rustc_deprecated(since = "TBD", reason = "replaced by the `MIN` associated constant on this type")]
#[deprecated(since = "TBD", note = "replaced by the `MIN` associated constant on this type")]
pub const fn min_value() -> Self {
Self::MIN
}
@ -2730,7 +2730,7 @@ macro_rules! int_impl {
#[inline(always)]
#[rustc_promotable]
#[rustc_const_stable(feature = "const_max_value", since = "1.32.0")]
#[rustc_deprecated(since = "TBD", reason = "replaced by the `MAX` associated constant on this type")]
#[deprecated(since = "TBD", note = "replaced by the `MAX` associated constant on this type")]
pub const fn max_value() -> Self {
Self::MAX
}

View file

@ -5,9 +5,9 @@
//! New code should use the associated constants directly on the primitive type.
#![stable(feature = "i128", since = "1.26.0")]
#![rustc_deprecated(
#![deprecated(
since = "TBD",
reason = "all constants in this module replaced by associated constants on `i128`"
note = "all constants in this module replaced by associated constants on `i128`"
)]
int_module! { i128, #[stable(feature = "i128", since="1.26.0")] }

View file

@ -5,9 +5,9 @@
//! New code should use the associated constants directly on the primitive type.
#![stable(feature = "rust1", since = "1.0.0")]
#![rustc_deprecated(
#![deprecated(
since = "TBD",
reason = "all constants in this module replaced by associated constants on `i16`"
note = "all constants in this module replaced by associated constants on `i16`"
)]
int_module! { i16 }

View file

@ -5,9 +5,9 @@
//! New code should use the associated constants directly on the primitive type.
#![stable(feature = "rust1", since = "1.0.0")]
#![rustc_deprecated(
#![deprecated(
since = "TBD",
reason = "all constants in this module replaced by associated constants on `i32`"
note = "all constants in this module replaced by associated constants on `i32`"
)]
int_module! { i32 }

View file

@ -5,9 +5,9 @@
//! New code should use the associated constants directly on the primitive type.
#![stable(feature = "rust1", since = "1.0.0")]
#![rustc_deprecated(
#![deprecated(
since = "TBD",
reason = "all constants in this module replaced by associated constants on `i64`"
note = "all constants in this module replaced by associated constants on `i64`"
)]
int_module! { i64 }

View file

@ -5,9 +5,9 @@
//! New code should use the associated constants directly on the primitive type.
#![stable(feature = "rust1", since = "1.0.0")]
#![rustc_deprecated(
#![deprecated(
since = "TBD",
reason = "all constants in this module replaced by associated constants on `i8`"
note = "all constants in this module replaced by associated constants on `i8`"
)]
int_module! { i8 }

View file

@ -19,7 +19,7 @@ macro_rules! int_module {
/// ```
///
#[$attr]
#[rustc_deprecated(since = "TBD", reason = "replaced by the `MIN` associated constant on this type")]
#[deprecated(since = "TBD", note = "replaced by the `MIN` associated constant on this type")]
pub const MIN: $T = $T::MIN;
#[doc = concat!(
@ -38,7 +38,7 @@ macro_rules! int_module {
/// ```
///
#[$attr]
#[rustc_deprecated(since = "TBD", reason = "replaced by the `MAX` associated constant on this type")]
#[deprecated(since = "TBD", note = "replaced by the `MAX` associated constant on this type")]
pub const MAX: $T = $T::MAX;
)
}

View file

@ -5,9 +5,9 @@
//! New code should use the associated constants directly on the primitive type.
#![stable(feature = "rust1", since = "1.0.0")]
#![rustc_deprecated(
#![deprecated(
since = "TBD",
reason = "all constants in this module replaced by associated constants on `isize`"
note = "all constants in this module replaced by associated constants on `isize`"
)]
int_module! { isize }

View file

@ -5,9 +5,9 @@
//! New code should use the associated constants directly on the primitive type.
#![stable(feature = "i128", since = "1.26.0")]
#![rustc_deprecated(
#![deprecated(
since = "TBD",
reason = "all constants in this module replaced by associated constants on `u128`"
note = "all constants in this module replaced by associated constants on `u128`"
)]
int_module! { u128, #[stable(feature = "i128", since="1.26.0")] }

View file

@ -5,9 +5,9 @@
//! New code should use the associated constants directly on the primitive type.
#![stable(feature = "rust1", since = "1.0.0")]
#![rustc_deprecated(
#![deprecated(
since = "TBD",
reason = "all constants in this module replaced by associated constants on `u16`"
note = "all constants in this module replaced by associated constants on `u16`"
)]
int_module! { u16 }

View file

@ -5,9 +5,9 @@
//! New code should use the associated constants directly on the primitive type.
#![stable(feature = "rust1", since = "1.0.0")]
#![rustc_deprecated(
#![deprecated(
since = "TBD",
reason = "all constants in this module replaced by associated constants on `u32`"
note = "all constants in this module replaced by associated constants on `u32`"
)]
int_module! { u32 }

View file

@ -5,9 +5,9 @@
//! New code should use the associated constants directly on the primitive type.
#![stable(feature = "rust1", since = "1.0.0")]
#![rustc_deprecated(
#![deprecated(
since = "TBD",
reason = "all constants in this module replaced by associated constants on `u64`"
note = "all constants in this module replaced by associated constants on `u64`"
)]
int_module! { u64 }

View file

@ -5,9 +5,9 @@
//! New code should use the associated constants directly on the primitive type.
#![stable(feature = "rust1", since = "1.0.0")]
#![rustc_deprecated(
#![deprecated(
since = "TBD",
reason = "all constants in this module replaced by associated constants on `u8`"
note = "all constants in this module replaced by associated constants on `u8`"
)]
int_module! { u8 }

View file

@ -5,9 +5,9 @@
//! New code should use the associated constants directly on the primitive type.
#![stable(feature = "rust1", since = "1.0.0")]
#![rustc_deprecated(
#![deprecated(
since = "TBD",
reason = "all constants in this module replaced by associated constants on `usize`"
note = "all constants in this module replaced by associated constants on `usize`"
)]
int_module! { usize }

View file

@ -2431,7 +2431,7 @@ macro_rules! uint_impl {
#[rustc_promotable]
#[inline(always)]
#[rustc_const_stable(feature = "const_max_value", since = "1.32.0")]
#[rustc_deprecated(since = "TBD", reason = "replaced by the `MIN` associated constant on this type")]
#[deprecated(since = "TBD", note = "replaced by the `MIN` associated constant on this type")]
pub const fn min_value() -> Self { Self::MIN }
/// New code should prefer to use
@ -2442,7 +2442,7 @@ macro_rules! uint_impl {
#[rustc_promotable]
#[inline(always)]
#[rustc_const_stable(feature = "const_max_value", since = "1.32.0")]
#[rustc_deprecated(since = "TBD", reason = "replaced by the `MAX` associated constant on this type")]
#[deprecated(since = "TBD", note = "replaced by the `MAX` associated constant on this type")]
pub const fn max_value() -> Self { Self::MAX }
}
}

View file

@ -1129,7 +1129,7 @@ impl FusedIterator for Lines<'_> {}
///
/// [`lines_any`]: str::lines_any
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(since = "1.4.0", reason = "use lines()/Lines instead now")]
#[deprecated(since = "1.4.0", note = "use lines()/Lines instead now")]
#[must_use = "iterators are lazy and do nothing unless consumed"]
#[derive(Clone, Debug)]
#[allow(deprecated)]

View file

@ -591,7 +591,7 @@ impl str {
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(since = "1.29.0", reason = "use `get_unchecked(begin..end)` instead")]
#[deprecated(since = "1.29.0", note = "use `get_unchecked(begin..end)` instead")]
#[must_use]
#[inline]
pub unsafe fn slice_unchecked(&self, begin: usize, end: usize) -> &str {
@ -625,7 +625,7 @@ impl str {
/// * `begin` and `end` must be byte positions within the string slice.
/// * `begin` and `end` must lie on UTF-8 sequence boundaries.
#[stable(feature = "str_slice_mut", since = "1.5.0")]
#[rustc_deprecated(since = "1.29.0", reason = "use `get_unchecked_mut(begin..end)` instead")]
#[deprecated(since = "1.29.0", note = "use `get_unchecked_mut(begin..end)` instead")]
#[inline]
pub unsafe fn slice_mut_unchecked(&mut self, begin: usize, end: usize) -> &mut str {
// SAFETY: the caller must uphold the safety contract for `get_unchecked_mut`;
@ -1000,7 +1000,7 @@ impl str {
/// An iterator over the lines of a string.
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(since = "1.4.0", reason = "use lines() instead now")]
#[deprecated(since = "1.4.0", note = "use lines() instead now")]
#[inline]
#[allow(deprecated)]
pub fn lines_any(&self) -> LinesAny<'_> {
@ -1964,11 +1964,7 @@ impl str {
without modifying the original"]
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
since = "1.33.0",
reason = "superseded by `trim_start`",
suggestion = "trim_start"
)]
#[deprecated(since = "1.33.0", note = "superseded by `trim_start`", suggestion = "trim_start")]
pub fn trim_left(&self) -> &str {
self.trim_start()
}
@ -2008,11 +2004,7 @@ impl str {
without modifying the original"]
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
since = "1.33.0",
reason = "superseded by `trim_end`",
suggestion = "trim_end"
)]
#[deprecated(since = "1.33.0", note = "superseded by `trim_end`", suggestion = "trim_end")]
pub fn trim_right(&self) -> &str {
self.trim_end()
}
@ -2240,9 +2232,9 @@ impl str {
/// assert_eq!("12foo1bar12".trim_left_matches(x), "foo1bar12");
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
#[deprecated(
since = "1.33.0",
reason = "superseded by `trim_start_matches`",
note = "superseded by `trim_start_matches`",
suggestion = "trim_start_matches"
)]
pub fn trim_left_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &'a str {
@ -2283,9 +2275,9 @@ impl str {
/// assert_eq!("1fooX".trim_right_matches(|c| c == '1' || c == 'X'), "1foo");
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
#[deprecated(
since = "1.33.0",
reason = "superseded by `trim_end_matches`",
note = "superseded by `trim_end_matches`",
suggestion = "trim_end_matches"
)]
pub fn trim_right_matches<'a, P>(&'a self, pat: P) -> &'a str

View file

@ -271,9 +271,9 @@ pub enum Ordering {
/// An [`AtomicBool`] initialized to `false`.
#[cfg(target_has_atomic_load_store = "8")]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
#[deprecated(
since = "1.34.0",
reason = "the `new` function is now preferred",
note = "the `new` function is now preferred",
suggestion = "AtomicBool::new(false)"
)]
pub const ATOMIC_BOOL_INIT: AtomicBool = AtomicBool::new(false);
@ -551,9 +551,9 @@ impl AtomicBool {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
#[deprecated(
since = "1.50.0",
reason = "Use `compare_exchange` or `compare_exchange_weak` instead"
note = "Use `compare_exchange` or `compare_exchange_weak` instead"
)]
#[cfg(target_has_atomic = "8")]
pub fn compare_and_swap(&self, current: bool, new: bool, order: Ordering) -> bool {
@ -1235,9 +1235,9 @@ impl<T> AtomicPtr<T> {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(
#[deprecated(
since = "1.50.0",
reason = "Use `compare_exchange` or `compare_exchange_weak` instead"
note = "Use `compare_exchange` or `compare_exchange_weak` instead"
)]
#[cfg(target_has_atomic = "ptr")]
pub fn compare_and_swap(&self, current: *mut T, new: *mut T, order: Ordering) -> *mut T {
@ -1490,9 +1490,9 @@ macro_rules! atomic_int {
/// An atomic integer initialized to `0`.
#[$stable_init_const]
#[rustc_deprecated(
#[deprecated(
since = "1.34.0",
reason = "the `new` function is now preferred",
note = "the `new` function is now preferred",
suggestion = $atomic_new,
)]
pub const $atomic_init: $atomic_type = $atomic_type::new(0);
@ -1812,9 +1812,9 @@ macro_rules! atomic_int {
/// ```
#[inline]
#[$stable]
#[rustc_deprecated(
#[deprecated(
since = "1.50.0",
reason = "Use `compare_exchange` or `compare_exchange_weak` instead")
note = "Use `compare_exchange` or `compare_exchange_weak` instead")
]
#[$cfg_cas]
pub fn compare_and_swap(&self,
@ -3023,7 +3023,7 @@ impl<T> fmt::Pointer for AtomicPtr<T> {
/// [`hint::spin_loop`]: crate::hint::spin_loop
#[inline]
#[stable(feature = "spin_loop_hint", since = "1.24.0")]
#[rustc_deprecated(since = "1.51.0", reason = "use hint::spin_loop instead")]
#[deprecated(since = "1.51.0", note = "use hint::spin_loop instead")]
pub fn spin_loop_hint() {
spin_loop()
}