Skip to content

Commit 6f3df00

Browse files
committedJan 21, 2021
Deprecate-in-future the constants superceded by RFC 2700
·
1.88.01.51.0
1 parent a4cbb44 commit 6f3df00

File tree

26 files changed

+241
-98
lines changed

26 files changed

+241
-98
lines changed
 

‎library/core/src/convert/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,6 @@ pub trait TryInto<T>: Sized {
460460
/// assert!(try_successful_smaller_number.is_ok());
461461
/// ```
462462
///
463-
/// [`i32::MAX`]: crate::i32::MAX
464463
/// [`try_from`]: TryFrom::try_from
465464
/// [`!`]: ../../std/primitive.never.html
466465
#[stable(feature = "try_from", since = "1.34.0")]

‎library/core/src/iter/adapters/chain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::iter::{DoubleEndedIterator, FusedIterator, Iterator, TrustedLen};
2-
use crate::{ops::Try, usize};
2+
use crate::ops::Try;
33

44
/// An iterator that links two iterators together, in a chain.
55
///

‎library/core/src/iter/traits/iterator.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,6 @@ pub trait Iterator {
225225
/// This function might panic if the iterator has more than [`usize::MAX`]
226226
/// elements.
227227
///
228-
/// [`usize::MAX`]: crate::usize::MAX
229-
///
230228
/// # Examples
231229
///
232230
/// Basic usage:
@@ -871,7 +869,6 @@ pub trait Iterator {
871869
/// overflow a [`usize`].
872870
///
873871
/// [`usize`]: type@usize
874-
/// [`usize::MAX`]: crate::usize::MAX
875872
/// [`zip`]: Iterator::zip
876873
///
877874
/// # Examples
@@ -2383,7 +2380,6 @@ pub trait Iterator {
23832380
/// non-matching elements.
23842381
///
23852382
/// [`Some(index)`]: Some
2386-
/// [`usize::MAX`]: crate::usize::MAX
23872383
///
23882384
/// # Examples
23892385
///

‎library/core/src/iter/traits/marker.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ impl<I: FusedIterator + ?Sized> FusedIterator for &mut I {}
3333
///
3434
/// This trait must only be implemented when the contract is upheld. Consumers
3535
/// of this trait must inspect [`Iterator::size_hint()`]’s upper bound.
36-
///
37-
/// [`usize::MAX`]: crate::usize::MAX
3836
#[unstable(feature = "trusted_len", issue = "37572")]
3937
#[rustc_unsafe_specialization_marker]
4038
pub unsafe trait TrustedLen: Iterator {}

‎library/core/src/num/f32.rs

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
//! This module provides constants which are specific to the implementation
2-
//! of the `f32` floating point data type.
1+
//! Constants specific to the `f32` single-precision floating point type.
32
//!
43
//! *[See also the `f32` primitive type](../../std/primitive.f32.html).*
54
//!
65
//! Mathematically significant numbers are provided in the `consts` sub-module.
76
//!
8-
//! Although using these constants won’t cause compilation warnings,
9-
//! new code should use the associated constants directly on the primitive type.
7+
//! For the constants defined directly in this module
8+
//! (as distinct from those defined in the `consts` sub-module),
9+
//! new code should instead use the associated constants
10+
//! defined directly on the `f32` type.
1011
1112
#![stable(feature = "rust1", since = "1.0.0")]
1213

@@ -23,12 +24,14 @@ use crate::num::FpCategory;
2324
///
2425
/// ```rust
2526
/// // deprecated way
27+
/// # #[allow(deprecated, deprecated_in_future)]
2628
/// let r = std::f32::RADIX;
2729
///
2830
/// // intended way
2931
/// let r = f32::RADIX;
3032
/// ```
3133
#[stable(feature = "rust1", since = "1.0.0")]
34+
#[rustc_deprecated(since = "TBD", reason = "replaced by the `RADIX` associated constant on `f32`")]
3235
pub const RADIX: u32 = f32::RADIX;
3336

3437
/// Number of significant digits in base 2.
@@ -38,12 +41,17 @@ pub const RADIX: u32 = f32::RADIX;
3841
///
3942
/// ```rust
4043
/// // deprecated way
44+
/// # #[allow(deprecated, deprecated_in_future)]
4145
/// let d = std::f32::MANTISSA_DIGITS;
4246
///
4347
/// // intended way
4448
/// let d = f32::MANTISSA_DIGITS;
4549
/// ```
4650
#[stable(feature = "rust1", since = "1.0.0")]
51+
#[rustc_deprecated(
52+
since = "TBD",
53+
reason = "replaced by the `MANTISSA_DIGITS` associated constant on `f32`"
54+
)]
4755
pub const MANTISSA_DIGITS: u32 = f32::MANTISSA_DIGITS;
4856

4957
/// Approximate number of significant digits in base 10.
@@ -53,12 +61,14 @@ pub const MANTISSA_DIGITS: u32 = f32::MANTISSA_DIGITS;
5361
///
5462
/// ```rust
5563
/// // deprecated way
64+
/// # #[allow(deprecated, deprecated_in_future)]
5665
/// let d = std::f32::DIGITS;
5766
///
5867
/// // intended way
5968
/// let d = f32::DIGITS;
6069
/// ```
6170
#[stable(feature = "rust1", since = "1.0.0")]
71+
#[rustc_deprecated(since = "TBD", reason = "replaced by the `DIGITS` associated constant on `f32`")]
6272
pub const DIGITS: u32 = f32::DIGITS;
6373

6474
/// [Machine epsilon] value for `f32`.
@@ -72,12 +82,17 @@ pub const DIGITS: u32 = f32::DIGITS;
7282
///
7383
/// ```rust
7484
/// // deprecated way
85+
/// # #[allow(deprecated, deprecated_in_future)]
7586
/// let e = std::f32::EPSILON;
7687
///
7788
/// // intended way
7889
/// let e = f32::EPSILON;
7990
/// ```
8091
#[stable(feature = "rust1", since = "1.0.0")]
92+
#[rustc_deprecated(
93+
since = "TBD",
94+
reason = "replaced by the `EPSILON` associated constant on `f32`"
95+
)]
8196
pub const EPSILON: f32 = f32::EPSILON;
8297

8398
/// Smallest finite `f32` value.
@@ -87,12 +102,14 @@ pub const EPSILON: f32 = f32::EPSILON;
87102
///
88103
/// ```rust
89104
/// // deprecated way
105+
/// # #[allow(deprecated, deprecated_in_future)]
90106
/// let min = std::f32::MIN;
91107
///
92108
/// // intended way
93109
/// let min = f32::MIN;
94110
/// ```
95111
#[stable(feature = "rust1", since = "1.0.0")]
112+
#[rustc_deprecated(since = "TBD", reason = "replaced by the `MIN` associated constant on `f32`")]
96113
pub const MIN: f32 = f32::MIN;
97114

98115
/// Smallest positive normal `f32` value.
@@ -102,12 +119,17 @@ pub const MIN: f32 = f32::MIN;
102119
///
103120
/// ```rust
104121
/// // deprecated way
122+
/// # #[allow(deprecated, deprecated_in_future)]
105123
/// let min = std::f32::MIN_POSITIVE;
106124
///
107125
/// // intended way
108126
/// let min = f32::MIN_POSITIVE;
109127
/// ```
110128
#[stable(feature = "rust1", since = "1.0.0")]
129+
#[rustc_deprecated(
130+
since = "TBD",
131+
reason = "replaced by the `MIN_POSITIVE` associated constant on `f32`"
132+
)]
111133
pub const MIN_POSITIVE: f32 = f32::MIN_POSITIVE;
112134

113135
/// Largest finite `f32` value.
@@ -117,12 +139,14 @@ pub const MIN_POSITIVE: f32 = f32::MIN_POSITIVE;
117139
///
118140
/// ```rust
119141
/// // deprecated way
142+
/// # #[allow(deprecated, deprecated_in_future)]
120143
/// let max = std::f32::MAX;
121144
///
122145
/// // intended way
123146
/// let max = f32::MAX;
124147
/// ```
125148
#[stable(feature = "rust1", since = "1.0.0")]
149+
#[rustc_deprecated(since = "TBD", reason = "replaced by the `MAX` associated constant on `f32`")]
126150
pub const MAX: f32 = f32::MAX;
127151

128152
/// One greater than the minimum possible normal power of 2 exponent.
@@ -132,12 +156,17 @@ pub const MAX: f32 = f32::MAX;
132156
///
133157
/// ```rust
134158
/// // deprecated way
159+
/// # #[allow(deprecated, deprecated_in_future)]
135160
/// let min = std::f32::MIN_EXP;
136161
///
137162
/// // intended way
138163
/// let min = f32::MIN_EXP;
139164
/// ```
140165
#[stable(feature = "rust1", since = "1.0.0")]
166+
#[rustc_deprecated(
167+
since = "TBD",
168+
reason = "replaced by the `MIN_EXP` associated constant on `f32`"
169+
)]
141170
pub const MIN_EXP: i32 = f32::MIN_EXP;
142171

143172
/// Maximum possible power of 2 exponent.
@@ -147,12 +176,17 @@ pub const MIN_EXP: i32 = f32::MIN_EXP;
147176
///
148177
/// ```rust
149178
/// // deprecated way
179+
/// # #[allow(deprecated, deprecated_in_future)]
150180
/// let max = std::f32::MAX_EXP;
151181
///
152182
/// // intended way
153183
/// let max = f32::MAX_EXP;
154184
/// ```
155185
#[stable(feature = "rust1", since = "1.0.0")]
186+
#[rustc_deprecated(
187+
since = "TBD",
188+
reason = "replaced by the `MAX_EXP` associated constant on `f32`"
189+
)]
156190
pub const MAX_EXP: i32 = f32::MAX_EXP;
157191

158192
/// Minimum possible normal power of 10 exponent.
@@ -162,12 +196,17 @@ pub const MAX_EXP: i32 = f32::MAX_EXP;
162196
///
163197
/// ```rust
164198
/// // deprecated way
199+
/// # #[allow(deprecated, deprecated_in_future)]
165200
/// let min = std::f32::MIN_10_EXP;
166201
///
167202
/// // intended way
168203
/// let min = f32::MIN_10_EXP;
169204
/// ```
170205
#[stable(feature = "rust1", since = "1.0.0")]
206+
#[rustc_deprecated(
207+
since = "TBD",
208+
reason = "replaced by the `MIN_10_EXP` associated constant on `f32`"
209+
)]
171210
pub const MIN_10_EXP: i32 = f32::MIN_10_EXP;
172211

173212
/// Maximum possible power of 10 exponent.
@@ -177,12 +216,17 @@ pub const MIN_10_EXP: i32 = f32::MIN_10_EXP;
177216
///
178217
/// ```rust
179218
/// // deprecated way
219+
/// # #[allow(deprecated, deprecated_in_future)]
180220
/// let max = std::f32::MAX_10_EXP;
181221
///
182222
/// // intended way
183223
/// let max = f32::MAX_10_EXP;
184224
/// ```
185225
#[stable(feature = "rust1", since = "1.0.0")]
226+
#[rustc_deprecated(
227+
since = "TBD",
228+
reason = "replaced by the `MAX_10_EXP` associated constant on `f32`"
229+
)]
186230
pub const MAX_10_EXP: i32 = f32::MAX_10_EXP;
187231

188232
/// Not a Number (NaN).
@@ -192,12 +236,14 @@ pub const MAX_10_EXP: i32 = f32::MAX_10_EXP;
192236
///
193237
/// ```rust
194238
/// // deprecated way
239+
/// # #[allow(deprecated, deprecated_in_future)]
195240
/// let nan = std::f32::NAN;
196241
///
197242
/// // intended way
198243
/// let nan = f32::NAN;
199244
/// ```
200245
#[stable(feature = "rust1", since = "1.0.0")]
246+
#[rustc_deprecated(since = "TBD", reason = "replaced by the `NAN` associated constant on `f32`")]
201247
pub const NAN: f32 = f32::NAN;
202248

203249
/// Infinity (∞).
@@ -207,12 +253,17 @@ pub const NAN: f32 = f32::NAN;
207253
///
208254
/// ```rust
209255
/// // deprecated way
256+
/// # #[allow(deprecated, deprecated_in_future)]
210257
/// let inf = std::f32::INFINITY;
211258
///
212259
/// // intended way
213260
/// let inf = f32::INFINITY;
214261
/// ```
215262
#[stable(feature = "rust1", since = "1.0.0")]
263+
#[rustc_deprecated(
264+
since = "TBD",
265+
reason = "replaced by the `INFINITY` associated constant on `f32`"
266+
)]
216267
pub const INFINITY: f32 = f32::INFINITY;
217268

218269
/// Negative infinity (−∞).
@@ -222,12 +273,17 @@ pub const INFINITY: f32 = f32::INFINITY;
222273
///
223274
/// ```rust
224275
/// // deprecated way
276+
/// # #[allow(deprecated, deprecated_in_future)]
225277
/// let ninf = std::f32::NEG_INFINITY;
226278
///
227279
/// // intended way
228280
/// let ninf = f32::NEG_INFINITY;
229281
/// ```
230282
#[stable(feature = "rust1", since = "1.0.0")]
283+
#[rustc_deprecated(
284+
since = "TBD",
285+
reason = "replaced by the `NEG_INFINITY` associated constant on `f32`"
286+
)]
231287
pub const NEG_INFINITY: f32 = f32::NEG_INFINITY;
232288

233289
/// Basic mathematical constants.

‎library/core/src/num/f64.rs

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
//! This module provides constants which are specific to the implementation
2-
//! of the `f64` floating point data type.
1+
//! Constants specific to the `f64` double-precision floating point type.
32
//!
43
//! *[See also the `f64` primitive type](../../std/primitive.f64.html).*
54
//!
65
//! Mathematically significant numbers are provided in the `consts` sub-module.
76
//!
8-
//! Although using these constants won’t cause compilation warnings,
9-
//! new code should use the associated constants directly on the primitive type.
7+
//! For the constants defined directly in this module
8+
//! (as distinct from those defined in the `consts` sub-module),
9+
//! new code should instead use the associated constants
10+
//! defined directly on the `f64` type.
1011
1112
#![stable(feature = "rust1", since = "1.0.0")]
1213

@@ -23,12 +24,14 @@ use crate::num::FpCategory;
2324
///
2425
/// ```rust
2526
/// // deprecated way
27+
/// # #[allow(deprecated, deprecated_in_future)]
2628
/// let r = std::f64::RADIX;
2729
///
2830
/// // intended way
2931
/// let r = f64::RADIX;
3032
/// ```
3133
#[stable(feature = "rust1", since = "1.0.0")]
34+
#[rustc_deprecated(since = "TBD", reason = "replaced by the `RADIX` associated constant on `f64`")]
3235
pub const RADIX: u32 = f64::RADIX;
3336

3437
/// Number of significant digits in base 2.
@@ -38,12 +41,17 @@ pub const RADIX: u32 = f64::RADIX;
3841
///
3942
/// ```rust
4043
/// // deprecated way
44+
/// # #[allow(deprecated, deprecated_in_future)]
4145
/// let d = std::f64::MANTISSA_DIGITS;
4246
///
4347
/// // intended way
4448
/// let d = f64::MANTISSA_DIGITS;
4549
/// ```
4650
#[stable(feature = "rust1", since = "1.0.0")]
51+
#[rustc_deprecated(
52+
since = "TBD",
53+
reason = "replaced by the `MANTISSA_DIGITS` associated constant on `f64`"
54+
)]
4755
pub const MANTISSA_DIGITS: u32 = f64::MANTISSA_DIGITS;
4856

4957
/// Approximate number of significant digits in base 10.
@@ -53,12 +61,14 @@ pub const MANTISSA_DIGITS: u32 = f64::MANTISSA_DIGITS;
5361
///
5462
/// ```rust
5563
/// // deprecated way
64+
/// # #[allow(deprecated, deprecated_in_future)]
5665
/// let d = std::f64::DIGITS;
5766
///
5867
/// // intended way
5968
/// let d = f64::DIGITS;
6069
/// ```
6170
#[stable(feature = "rust1", since = "1.0.0")]
71+
#[rustc_deprecated(since = "TBD", reason = "replaced by the `DIGITS` associated constant on `f64`")]
6272
pub const DIGITS: u32 = f64::DIGITS;
6373

6474
/// [Machine epsilon] value for `f64`.
@@ -72,12 +82,17 @@ pub const DIGITS: u32 = f64::DIGITS;
7282
///
7383
/// ```rust
7484
/// // deprecated way
85+
/// # #[allow(deprecated, deprecated_in_future)]
7586
/// let e = std::f64::EPSILON;
7687
///
7788
/// // intended way
7889
/// let e = f64::EPSILON;
7990
/// ```
8091
#[stable(feature = "rust1", since = "1.0.0")]
92+
#[rustc_deprecated(
93+
since = "TBD",
94+
reason = "replaced by the `EPSILON` associated constant on `f64`"
95+
)]
8196
pub const EPSILON: f64 = f64::EPSILON;
8297

8398
/// Smallest finite `f64` value.
@@ -87,12 +102,14 @@ pub const EPSILON: f64 = f64::EPSILON;
87102
///
88103
/// ```rust
89104
/// // deprecated way
105+
/// # #[allow(deprecated, deprecated_in_future)]
90106
/// let min = std::f64::MIN;
91107
///
92108
/// // intended way
93109
/// let min = f64::MIN;
94110
/// ```
95111
#[stable(feature = "rust1", since = "1.0.0")]
112+
#[rustc_deprecated(since = "TBD", reason = "replaced by the `MIN` associated constant on `f64`")]
96113
pub const MIN: f64 = f64::MIN;
97114

98115
/// Smallest positive normal `f64` value.
@@ -102,12 +119,17 @@ pub const MIN: f64 = f64::MIN;
102119
///
103120
/// ```rust
104121
/// // deprecated way
122+
/// # #[allow(deprecated, deprecated_in_future)]
105123
/// let min = std::f64::MIN_POSITIVE;
106124
///
107125
/// // intended way
108126
/// let min = f64::MIN_POSITIVE;
109127
/// ```
110128
#[stable(feature = "rust1", since = "1.0.0")]
129+
#[rustc_deprecated(
130+
since = "TBD",
131+
reason = "replaced by the `MIN_POSITIVE` associated constant on `f64`"
132+
)]
111133
pub const MIN_POSITIVE: f64 = f64::MIN_POSITIVE;
112134

113135
/// Largest finite `f64` value.
@@ -117,12 +139,14 @@ pub const MIN_POSITIVE: f64 = f64::MIN_POSITIVE;
117139
///
118140
/// ```rust
119141
/// // deprecated way
142+
/// # #[allow(deprecated, deprecated_in_future)]
120143
/// let max = std::f64::MAX;
121144
///
122145
/// // intended way
123146
/// let max = f64::MAX;
124147
/// ```
125148
#[stable(feature = "rust1", since = "1.0.0")]
149+
#[rustc_deprecated(since = "TBD", reason = "replaced by the `MAX` associated constant on `f64`")]
126150
pub const MAX: f64 = f64::MAX;
127151

128152
/// One greater than the minimum possible normal power of 2 exponent.
@@ -132,12 +156,17 @@ pub const MAX: f64 = f64::MAX;
132156
///
133157
/// ```rust
134158
/// // deprecated way
159+
/// # #[allow(deprecated, deprecated_in_future)]
135160
/// let min = std::f64::MIN_EXP;
136161
///
137162
/// // intended way
138163
/// let min = f64::MIN_EXP;
139164
/// ```
140165
#[stable(feature = "rust1", since = "1.0.0")]
166+
#[rustc_deprecated(
167+
since = "TBD",
168+
reason = "replaced by the `MIN_EXP` associated constant on `f64`"
169+
)]
141170
pub const MIN_EXP: i32 = f64::MIN_EXP;
142171

143172
/// Maximum possible power of 2 exponent.
@@ -147,12 +176,17 @@ pub const MIN_EXP: i32 = f64::MIN_EXP;
147176
///
148177
/// ```rust
149178
/// // deprecated way
179+
/// # #[allow(deprecated, deprecated_in_future)]
150180
/// let max = std::f64::MAX_EXP;
151181
///
152182
/// // intended way
153183
/// let max = f64::MAX_EXP;
154184
/// ```
155185
#[stable(feature = "rust1", since = "1.0.0")]
186+
#[rustc_deprecated(
187+
since = "TBD",
188+
reason = "replaced by the `MAX_EXP` associated constant on `f64`"
189+
)]
156190
pub const MAX_EXP: i32 = f64::MAX_EXP;
157191

158192
/// Minimum possible normal power of 10 exponent.
@@ -162,12 +196,17 @@ pub const MAX_EXP: i32 = f64::MAX_EXP;
162196
///
163197
/// ```rust
164198
/// // deprecated way
199+
/// # #[allow(deprecated, deprecated_in_future)]
165200
/// let min = std::f64::MIN_10_EXP;
166201
///
167202
/// // intended way
168203
/// let min = f64::MIN_10_EXP;
169204
/// ```
170205
#[stable(feature = "rust1", since = "1.0.0")]
206+
#[rustc_deprecated(
207+
since = "TBD",
208+
reason = "replaced by the `MIN_10_EXP` associated constant on `f64`"
209+
)]
171210
pub const MIN_10_EXP: i32 = f64::MIN_10_EXP;
172211

173212
/// Maximum possible power of 10 exponent.
@@ -177,12 +216,17 @@ pub const MIN_10_EXP: i32 = f64::MIN_10_EXP;
177216
///
178217
/// ```rust
179218
/// // deprecated way
219+
/// # #[allow(deprecated, deprecated_in_future)]
180220
/// let max = std::f64::MAX_10_EXP;
181221
///
182222
/// // intended way
183223
/// let max = f64::MAX_10_EXP;
184224
/// ```
185225
#[stable(feature = "rust1", since = "1.0.0")]
226+
#[rustc_deprecated(
227+
since = "TBD",
228+
reason = "replaced by the `MAX_10_EXP` associated constant on `f64`"
229+
)]
186230
pub const MAX_10_EXP: i32 = f64::MAX_10_EXP;
187231

188232
/// Not a Number (NaN).
@@ -192,12 +236,14 @@ pub const MAX_10_EXP: i32 = f64::MAX_10_EXP;
192236
///
193237
/// ```rust
194238
/// // deprecated way
239+
/// # #[allow(deprecated, deprecated_in_future)]
195240
/// let nan = std::f64::NAN;
196241
///
197242
/// // intended way
198243
/// let nan = f64::NAN;
199244
/// ```
200245
#[stable(feature = "rust1", since = "1.0.0")]
246+
#[rustc_deprecated(since = "TBD", reason = "replaced by the `NAN` associated constant on `f64`")]
201247
pub const NAN: f64 = f64::NAN;
202248

203249
/// Infinity (∞).
@@ -207,12 +253,17 @@ pub const NAN: f64 = f64::NAN;
207253
///
208254
/// ```rust
209255
/// // deprecated way
256+
/// # #[allow(deprecated, deprecated_in_future)]
210257
/// let inf = std::f64::INFINITY;
211258
///
212259
/// // intended way
213260
/// let inf = f64::INFINITY;
214261
/// ```
215262
#[stable(feature = "rust1", since = "1.0.0")]
263+
#[rustc_deprecated(
264+
since = "TBD",
265+
reason = "replaced by the `INFINITY` associated constant on `f64`"
266+
)]
216267
pub const INFINITY: f64 = f64::INFINITY;
217268

218269
/// Negative infinity (−∞).
@@ -222,12 +273,17 @@ pub const INFINITY: f64 = f64::INFINITY;
222273
///
223274
/// ```rust
224275
/// // deprecated way
276+
/// # #[allow(deprecated, deprecated_in_future)]
225277
/// let ninf = std::f64::NEG_INFINITY;
226278
///
227279
/// // intended way
228280
/// let ninf = f64::NEG_INFINITY;
229281
/// ```
230282
#[stable(feature = "rust1", since = "1.0.0")]
283+
#[rustc_deprecated(
284+
since = "TBD",
285+
reason = "replaced by the `NEG_INFINITY` associated constant on `f64`"
286+
)]
231287
pub const NEG_INFINITY: f64 = f64::NEG_INFINITY;
232288

233289
/// Basic mathematical constants.

‎library/core/src/num/int_macros.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1975,32 +1975,28 @@ macro_rules! int_impl {
19751975
unsafe { mem::transmute(bytes) }
19761976
}
19771977

1978-
/// **This method is soft-deprecated.**
1979-
///
1980-
/// Although using it won’t cause a compilation warning, new code should use
1981-
#[doc = concat!("[`", stringify!($SelfT), "::MIN", "`](#associatedconstant.MIN)")]
1982-
/// instead.
1978+
/// New code should prefer to use
1979+
#[doc = concat!("[`", stringify!($SelfT), "::MIN", "`](#associatedconstant.MIN).")]
19831980
///
19841981
/// Returns the smallest value that can be represented by this integer type.
19851982
#[stable(feature = "rust1", since = "1.0.0")]
19861983
#[inline(always)]
19871984
#[rustc_promotable]
19881985
#[rustc_const_stable(feature = "const_min_value", since = "1.32.0")]
1986+
#[rustc_deprecated(since = "TBD", reason = "replaced by the `MIN` associated constant on this type")]
19891987
pub const fn min_value() -> Self {
19901988
Self::MIN
19911989
}
19921990

1993-
/// **This method is soft-deprecated.**
1994-
///
1995-
/// Although using it won’t cause a compilation warning, new code should use
1996-
#[doc = concat!("[`", stringify!($SelfT), "::MAX", "`](#associatedconstant.MAX)")]
1997-
/// instead.
1991+
/// New code should prefer to use
1992+
#[doc = concat!("[`", stringify!($SelfT), "::MAX", "`](#associatedconstant.MAX).")]
19981993
///
19991994
/// Returns the largest value that can be represented by this integer type.
20001995
#[stable(feature = "rust1", since = "1.0.0")]
20011996
#[inline(always)]
20021997
#[rustc_promotable]
20031998
#[rustc_const_stable(feature = "const_max_value", since = "1.32.0")]
1999+
#[rustc_deprecated(since = "TBD", reason = "replaced by the `MAX` associated constant on this type")]
20042000
pub const fn max_value() -> Self {
20052001
Self::MAX
20062002
}

‎library/core/src/num/shells/i128.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
//! The 128-bit signed integer type.
1+
//! Constants for the 128-bit signed integer type.
22
//!
33
//! *[See also the `i128` primitive type](../../std/primitive.i128.html).*
44
//!
5-
//! Although using these constants won’t cause compilation warnings,
6-
//! new code should use the associated constants directly on the primitive type.
5+
//! New code should use the associated constants directly on the primitive type.
76
87
#![stable(feature = "i128", since = "1.26.0")]
8+
#![rustc_deprecated(
9+
since = "TBD",
10+
reason = "all constants in this module replaced by associated constants on `i128`"
11+
)]
912

1013
int_module! { i128, #[stable(feature = "i128", since="1.26.0")] }

‎library/core/src/num/shells/i16.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
//! The 16-bit signed integer type.
1+
//! Constants for the 16-bit signed integer type.
22
//!
33
//! *[See also the `i16` primitive type](../../std/primitive.i16.html).*
44
//!
5-
//! Although using these constants won’t cause compilation warnings,
6-
//! new code should use the associated constants directly on the primitive type.
5+
//! New code should use the associated constants directly on the primitive type.
76
87
#![stable(feature = "rust1", since = "1.0.0")]
8+
#![rustc_deprecated(
9+
since = "TBD",
10+
reason = "all constants in this module replaced by associated constants on `i16`"
11+
)]
912

1013
int_module! { i16 }

‎library/core/src/num/shells/i32.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
//! The 32-bit signed integer type.
1+
//! Constants for the 32-bit signed integer type.
22
//!
33
//! *[See also the `i32` primitive type](../../std/primitive.i32.html).*
44
//!
5-
//! Although using these constants won’t cause compilation warnings,
6-
//! new code should use the associated constants directly on the primitive type.
5+
//! New code should use the associated constants directly on the primitive type.
76
87
#![stable(feature = "rust1", since = "1.0.0")]
8+
#![rustc_deprecated(
9+
since = "TBD",
10+
reason = "all constants in this module replaced by associated constants on `i32`"
11+
)]
912

1013
int_module! { i32 }

‎library/core/src/num/shells/i64.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
//! The 64-bit signed integer type.
1+
//! Constants for the 64-bit signed integer type.
22
//!
33
//! *[See also the `i64` primitive type](../../std/primitive.i64.html).*
44
//!
5-
//! Although using these constants won’t cause compilation warnings,
6-
//! new code should use the associated constants directly on the primitive type.
5+
//! New code should use the associated constants directly on the primitive type.
76
87
#![stable(feature = "rust1", since = "1.0.0")]
8+
#![rustc_deprecated(
9+
since = "TBD",
10+
reason = "all constants in this module replaced by associated constants on `i64`"
11+
)]
912

1013
int_module! { i64 }

‎library/core/src/num/shells/i8.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
//! The 8-bit signed integer type.
1+
//! Constants for the 8-bit signed integer type.
22
//!
33
//! *[See also the `i8` primitive type](../../std/primitive.i8.html).*
44
//!
5-
//! Although using these constants won’t cause compilation warnings,
6-
//! new code should use the associated constants directly on the primitive type.
5+
//! New code should use the associated constants directly on the primitive type.
76
87
#![stable(feature = "rust1", since = "1.0.0")]
8+
#![rustc_deprecated(
9+
since = "TBD",
10+
reason = "all constants in this module replaced by associated constants on `i8`"
11+
)]
912

1013
int_module! { i8 }

‎library/core/src/num/shells/int_macros.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ macro_rules! int_module {
2020
/// ```
2121
///
2222
#[$attr]
23+
#[rustc_deprecated(since = "TBD", reason = "replaced by the `MIN` associated constant on this type")]
2324
pub const MIN: $T = $T::MIN;
2425

2526
#[doc = concat!(
@@ -39,6 +40,7 @@ macro_rules! int_module {
3940
/// ```
4041
///
4142
#[$attr]
43+
#[rustc_deprecated(since = "TBD", reason = "replaced by the `MAX` associated constant on this type")]
4244
pub const MAX: $T = $T::MAX;
4345
)
4446
}

‎library/core/src/num/shells/isize.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
//! The pointer-sized signed integer type.
1+
//! Constants for the pointer-sized signed integer type.
22
//!
33
//! *[See also the `isize` primitive type](../../std/primitive.isize.html).*
44
//!
5-
//! Although using these constants won’t cause compilation warnings,
6-
//! new code should use the associated constants directly on the primitive type.
5+
//! New code should use the associated constants directly on the primitive type.
76
87
#![stable(feature = "rust1", since = "1.0.0")]
8+
#![rustc_deprecated(
9+
since = "TBD",
10+
reason = "all constants in this module replaced by associated constants on `isize`"
11+
)]
912

1013
int_module! { isize }

‎library/core/src/num/shells/u128.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
//! The 128-bit unsigned integer type.
1+
//! Constants for the 128-bit unsigned integer type.
22
//!
33
//! *[See also the `u128` primitive type](../../std/primitive.u128.html).*
44
//!
5-
//! Although using these constants won’t cause compilation warnings,
6-
//! new code should use the associated constants directly on the primitive type.
5+
//! New code should use the associated constants directly on the primitive type.
76
87
#![stable(feature = "i128", since = "1.26.0")]
8+
#![rustc_deprecated(
9+
since = "TBD",
10+
reason = "all constants in this module replaced by associated constants on `u128`"
11+
)]
12+
913
int_module! { u128, #[stable(feature = "i128", since="1.26.0")] }

‎library/core/src/num/shells/u16.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
//! The 16-bit unsigned integer type.
1+
//! Constants for the 16-bit unsigned integer type.
22
//!
33
//! *[See also the `u16` primitive type](../../std/primitive.u16.html).*
44
//!
5-
//! Although using these constants won’t cause compilation warnings,
6-
//! new code should use the associated constants directly on the primitive type.
5+
//! New code should use the associated constants directly on the primitive type.
76
87
#![stable(feature = "rust1", since = "1.0.0")]
8+
#![rustc_deprecated(
9+
since = "TBD",
10+
reason = "all constants in this module replaced by associated constants on `u16`"
11+
)]
912

1013
int_module! { u16 }

‎library/core/src/num/shells/u32.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
//! The 32-bit unsigned integer type.
1+
//! Constants for the 32-bit unsigned integer type.
22
//!
33
//! *[See also the `u32` primitive type](../../std/primitive.u32.html).*
44
//!
5-
//! Although using these constants won’t cause compilation warnings,
6-
//! new code should use the associated constants directly on the primitive type.
5+
//! New code should use the associated constants directly on the primitive type.
76
87
#![stable(feature = "rust1", since = "1.0.0")]
8+
#![rustc_deprecated(
9+
since = "TBD",
10+
reason = "all constants in this module replaced by associated constants on `u32`"
11+
)]
912

1013
int_module! { u32 }

‎library/core/src/num/shells/u64.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
//! The 64-bit unsigned integer type.
1+
//! Constants for the 64-bit unsigned integer type.
22
//!
33
//! *[See also the `u64` primitive type](../../std/primitive.u64.html).*
44
//!
5-
//! Although using these constants won’t cause compilation warnings,
6-
//! new code should use the associated constants directly on the primitive type.
5+
//! New code should use the associated constants directly on the primitive type.
76
87
#![stable(feature = "rust1", since = "1.0.0")]
8+
#![rustc_deprecated(
9+
since = "TBD",
10+
reason = "all constants in this module replaced by associated constants on `u64`"
11+
)]
912

1013
int_module! { u64 }

‎library/core/src/num/shells/u8.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
//! The 8-bit unsigned integer type.
1+
//! Constants for the 8-bit unsigned integer type.
22
//!
33
//! *[See also the `u8` primitive type](../../std/primitive.u8.html).*
44
//!
5-
//! Although using these constants won’t cause compilation warnings,
6-
//! new code should use the associated constants directly on the primitive type.
5+
//! New code should use the associated constants directly on the primitive type.
76
87
#![stable(feature = "rust1", since = "1.0.0")]
8+
#![rustc_deprecated(
9+
since = "TBD",
10+
reason = "all constants in this module replaced by associated constants on `u8`"
11+
)]
912

1013
int_module! { u8 }

‎library/core/src/num/shells/usize.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
//! The pointer-sized unsigned integer type.
1+
//! Constants for the pointer-sized unsigned integer type.
22
//!
33
//! *[See also the `usize` primitive type](../../std/primitive.usize.html).*
44
//!
5-
//! Although using these constants won’t cause compilation warnings,
6-
//! new code should use the associated constants directly on the primitive type.
5+
//! New code should use the associated constants directly on the primitive type.
76
87
#![stable(feature = "rust1", since = "1.0.0")]
8+
#![rustc_deprecated(
9+
since = "TBD",
10+
reason = "all constants in this module replaced by associated constants on `usize`"
11+
)]
912

1013
int_module! { usize }

‎library/core/src/num/uint_macros.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1805,30 +1805,28 @@ macro_rules! uint_impl {
18051805
unsafe { mem::transmute(bytes) }
18061806
}
18071807

1808-
/// **This method is soft-deprecated.**
1809-
///
1810-
/// Although using it won’t cause compilation warning, new code should use
1811-
#[doc = concat!("[`", stringify!($SelfT), "::MIN", "`](#associatedconstant.MIN)")]
1808+
/// New code should prefer to use
1809+
#[doc = concat!("[`", stringify!($SelfT), "::MIN", "`](#associatedconstant.MIN).")]
18121810
/// instead.
18131811
///
18141812
/// Returns the smallest value that can be represented by this integer type.
18151813
#[stable(feature = "rust1", since = "1.0.0")]
18161814
#[rustc_promotable]
18171815
#[inline(always)]
18181816
#[rustc_const_stable(feature = "const_max_value", since = "1.32.0")]
1817+
#[rustc_deprecated(since = "TBD", reason = "replaced by the `MIN` associated constant on this type")]
18191818
pub const fn min_value() -> Self { Self::MIN }
18201819

1821-
/// **This method is soft-deprecated.**
1822-
///
1823-
/// Although using it won’t cause compilation warning, new code should use
1824-
#[doc = concat!("[`", stringify!($SelfT), "::MAX", "`](#associatedconstant.MAX)")]
1820+
/// New code should prefer to use
1821+
#[doc = concat!("[`", stringify!($SelfT), "::MAX", "`](#associatedconstant.MAX).")]
18251822
/// instead.
18261823
///
18271824
/// Returns the largest value that can be represented by this integer type.
18281825
#[stable(feature = "rust1", since = "1.0.0")]
18291826
#[rustc_promotable]
18301827
#[inline(always)]
18311828
#[rustc_const_stable(feature = "const_max_value", since = "1.32.0")]
1829+
#[rustc_deprecated(since = "TBD", reason = "replaced by the `MAX` associated constant on this type")]
18321830
pub const fn max_value() -> Self { Self::MAX }
18331831
}
18341832
}

‎library/std/src/f32.rs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
//! This module provides constants which are specific to the implementation
2-
//! of the `f32` floating point data type.
1+
//! Constants specific to the `f32` single-precision floating point type.
32
//!
43
//! *[See also the `f32` primitive type](primitive@f32).*
54
//!
65
//! Mathematically significant numbers are provided in the `consts` sub-module.
76
//!
8-
//! Although using these constants won’t cause compilation warnings,
9-
//! new code should use the associated constants directly on the primitive type.
7+
//! For the constants defined directly in this module
8+
//! (as distinct from those defined in the `consts` sub-module),
9+
//! new code should instead use the associated constants
10+
//! defined directly on the `f32` type.
1011
1112
#![stable(feature = "rust1", since = "1.0.0")]
1213
#![allow(missing_docs)]
@@ -20,15 +21,11 @@ use crate::intrinsics;
2021
use crate::sys::cmath;
2122

2223
#[stable(feature = "rust1", since = "1.0.0")]
23-
pub use core::f32::consts;
24-
#[stable(feature = "rust1", since = "1.0.0")]
25-
pub use core::f32::{DIGITS, EPSILON, MANTISSA_DIGITS, RADIX};
26-
#[stable(feature = "rust1", since = "1.0.0")]
27-
pub use core::f32::{INFINITY, MAX_10_EXP, NAN, NEG_INFINITY};
28-
#[stable(feature = "rust1", since = "1.0.0")]
29-
pub use core::f32::{MAX, MIN, MIN_POSITIVE};
30-
#[stable(feature = "rust1", since = "1.0.0")]
31-
pub use core::f32::{MAX_EXP, MIN_10_EXP, MIN_EXP};
24+
#[allow(deprecated, deprecated_in_future)]
25+
pub use core::f32::{
26+
consts, DIGITS, EPSILON, INFINITY, MANTISSA_DIGITS, MAX, MAX_10_EXP, MAX_EXP, MIN, MIN_10_EXP,
27+
MIN_EXP, MIN_POSITIVE, NAN, NEG_INFINITY, RADIX,
28+
};
3229

3330
#[cfg(not(test))]
3431
#[lang = "f32_runtime"]

‎library/std/src/f64.rs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
//! This module provides constants which are specific to the implementation
2-
//! of the `f64` floating point data type.
1+
//! Constants specific to the `f64` double-precision floating point type.
32
//!
43
//! *[See also the `f64` primitive type](primitive@f64).*
54
//!
65
//! Mathematically significant numbers are provided in the `consts` sub-module.
76
//!
8-
//! Although using these constants won’t cause compilation warnings,
9-
//! new code should use the associated constants directly on the primitive type.
7+
//! For the constants defined directly in this module
8+
//! (as distinct from those defined in the `consts` sub-module),
9+
//! new code should instead use the associated constants
10+
//! defined directly on the `f64` type.
1011
1112
#![stable(feature = "rust1", since = "1.0.0")]
1213
#![allow(missing_docs)]
@@ -20,15 +21,11 @@ use crate::intrinsics;
2021
use crate::sys::cmath;
2122

2223
#[stable(feature = "rust1", since = "1.0.0")]
23-
pub use core::f64::consts;
24-
#[stable(feature = "rust1", since = "1.0.0")]
25-
pub use core::f64::{DIGITS, EPSILON, MANTISSA_DIGITS, RADIX};
26-
#[stable(feature = "rust1", since = "1.0.0")]
27-
pub use core::f64::{INFINITY, MAX_10_EXP, NAN, NEG_INFINITY};
28-
#[stable(feature = "rust1", since = "1.0.0")]
29-
pub use core::f64::{MAX, MIN, MIN_POSITIVE};
30-
#[stable(feature = "rust1", since = "1.0.0")]
31-
pub use core::f64::{MAX_EXP, MIN_10_EXP, MIN_EXP};
24+
#[allow(deprecated, deprecated_in_future)]
25+
pub use core::f64::{
26+
consts, DIGITS, EPSILON, INFINITY, MANTISSA_DIGITS, MAX, MAX_10_EXP, MAX_EXP, MIN, MIN_10_EXP,
27+
MIN_EXP, MIN_POSITIVE, NAN, NEG_INFINITY, RADIX,
28+
};
3229

3330
#[cfg(not(test))]
3431
#[lang = "f64_runtime"]

‎library/std/src/lib.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,18 +411,24 @@ pub use core::hash;
411411
#[stable(feature = "core_hint", since = "1.27.0")]
412412
pub use core::hint;
413413
#[stable(feature = "i128", since = "1.26.0")]
414+
#[allow(deprecated, deprecated_in_future)]
414415
pub use core::i128;
415416
#[stable(feature = "rust1", since = "1.0.0")]
417+
#[allow(deprecated, deprecated_in_future)]
416418
pub use core::i16;
417419
#[stable(feature = "rust1", since = "1.0.0")]
420+
#[allow(deprecated, deprecated_in_future)]
418421
pub use core::i32;
419422
#[stable(feature = "rust1", since = "1.0.0")]
423+
#[allow(deprecated, deprecated_in_future)]
420424
pub use core::i64;
421425
#[stable(feature = "rust1", since = "1.0.0")]
426+
#[allow(deprecated, deprecated_in_future)]
422427
pub use core::i8;
423428
#[stable(feature = "rust1", since = "1.0.0")]
424429
pub use core::intrinsics;
425430
#[stable(feature = "rust1", since = "1.0.0")]
431+
#[allow(deprecated, deprecated_in_future)]
426432
pub use core::isize;
427433
#[stable(feature = "rust1", since = "1.0.0")]
428434
pub use core::iter;
@@ -443,16 +449,22 @@ pub use core::raw;
443449
#[stable(feature = "rust1", since = "1.0.0")]
444450
pub use core::result;
445451
#[stable(feature = "i128", since = "1.26.0")]
452+
#[allow(deprecated, deprecated_in_future)]
446453
pub use core::u128;
447454
#[stable(feature = "rust1", since = "1.0.0")]
455+
#[allow(deprecated, deprecated_in_future)]
448456
pub use core::u16;
449457
#[stable(feature = "rust1", since = "1.0.0")]
458+
#[allow(deprecated, deprecated_in_future)]
450459
pub use core::u32;
451460
#[stable(feature = "rust1", since = "1.0.0")]
461+
#[allow(deprecated, deprecated_in_future)]
452462
pub use core::u64;
453463
#[stable(feature = "rust1", since = "1.0.0")]
464+
#[allow(deprecated, deprecated_in_future)]
454465
pub use core::u8;
455466
#[stable(feature = "rust1", since = "1.0.0")]
467+
#[allow(deprecated, deprecated_in_future)]
456468
pub use core::usize;
457469

458470
pub mod f32;

‎library/std/src/sys/unix/process/zircon.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#![allow(non_camel_case_types, unused)]
22

33
use crate::convert::TryInto;
4-
use crate::i64;
54
use crate::io;
65
use crate::mem::MaybeUninit;
76
use crate::os::raw::c_char;

‎src/test/rustdoc/reexport-check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
extern crate reexport_check;
55

66
// @!has 'foo/index.html' '//code' 'pub use self::i32;'
7-
// @has 'foo/index.html' '//tr[@class="module-item"]' 'i32'
7+
// @has 'foo/index.html' '//tr[@class="deprecated module-item"]' 'i32'
88
// @has 'foo/i32/index.html'
99
#[allow(deprecated, deprecated_in_future)]
1010
pub use std::i32;

0 commit comments

Comments
 (0)
Please sign in to comment.