Skip to content

Commit 4beceab

Browse files
committed
Formally deprecate numeric consts modules
Long-overdue successor to #80958
1 parent 122cbd0 commit 4beceab

File tree

17 files changed

+104
-94
lines changed

17 files changed

+104
-94
lines changed

compiler/rustc_query_system/src/dep_graph/serialized.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use std::cmp::max;
4444
use std::marker::PhantomData;
4545
use std::sync::Arc;
4646
use std::sync::atomic::Ordering;
47-
use std::{iter, mem, u64};
47+
use std::{iter, mem};
4848

4949
use rustc_data_structures::fingerprint::{Fingerprint, PackedFingerprint};
5050
use rustc_data_structures::fx::FxHashMap;

library/alloc/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
// Lints:
7373
#![deny(unsafe_op_in_unsafe_fn)]
7474
#![deny(fuzzy_provenance_casts)]
75-
#![warn(deprecated_in_future)]
75+
#![warn(deprecated)]
7676
#![warn(missing_debug_implementations)]
7777
#![warn(missing_docs)]
7878
#![allow(explicit_outlives_requirements)]

library/alloctests/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#![no_std]
55
// Lints:
66
#![deny(unsafe_op_in_unsafe_fn)]
7-
#![warn(deprecated_in_future)]
7+
#![warn(deprecated)]
88
#![warn(missing_debug_implementations)]
99
#![allow(explicit_outlives_requirements)]
1010
#![allow(internal_features)]

library/compiler-builtins/libm/src/math/rem_pio2f.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
* ====================================================
1515
*/
1616

17-
use core::f64;
18-
1917
use super::rem_pio2_large;
2018

2119
const TOINT: f64 = 1.5 / f64::EPSILON;

library/core/src/alloc/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub use self::layout::Layout;
1515
note = "Name does not follow std convention, use LayoutError",
1616
suggestion = "LayoutError"
1717
)]
18-
#[allow(deprecated, deprecated_in_future)]
18+
#[allow(deprecated)]
1919
pub use self::layout::LayoutErr;
2020
#[stable(feature = "alloc_layout_error", since = "1.50.0")]
2121
pub use self::layout::LayoutError;

library/core/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
#![deny(rust_2021_incompatible_or_patterns)]
8181
#![deny(unsafe_op_in_unsafe_fn)]
8282
#![deny(fuzzy_provenance_casts)]
83-
#![warn(deprecated_in_future)]
83+
#![warn(deprecated)]
8484
#![warn(missing_debug_implementations)]
8585
#![warn(missing_docs)]
8686
#![allow(explicit_outlives_requirements)]
@@ -258,11 +258,11 @@ mod internal_macros;
258258
mod legacy_int_modules;
259259
#[stable(feature = "rust1", since = "1.0.0")]
260260
#[allow(clippy::useless_attribute)] // FIXME false positive (https://github.com/rust-lang/rust-clippy/issues/15636)
261-
#[allow(deprecated_in_future)]
261+
#[allow(deprecated)]
262262
pub use legacy_int_modules::{i8, i16, i32, i64, isize, u8, u16, u32, u64, usize};
263263
#[stable(feature = "i128", since = "1.26.0")]
264264
#[allow(clippy::useless_attribute)] // FIXME false positive (https://github.com/rust-lang/rust-clippy/issues/15636)
265-
#[allow(deprecated_in_future)]
265+
#[allow(deprecated)]
266266
pub use legacy_int_modules::{i128, u128};
267267

268268
#[path = "num/f128.rs"]
@@ -374,7 +374,7 @@ pub mod primitive;
374374
unused_imports,
375375
unsafe_op_in_unsafe_fn,
376376
ambiguous_glob_reexports,
377-
deprecated_in_future,
377+
deprecated,
378378
unreachable_pub
379379
)]
380380
#[allow(rustdoc::bare_urls)]

library/core/src/num/f32.rs

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ use crate::{cfg_select, intrinsics, mem};
2323
///
2424
/// ```rust
2525
/// // deprecated way
26-
/// # #[allow(deprecated, deprecated_in_future)]
26+
/// # #[allow(deprecated)]
2727
/// let r = std::f32::RADIX;
2828
///
2929
/// // intended way
3030
/// let r = f32::RADIX;
3131
/// ```
3232
#[stable(feature = "rust1", since = "1.0.0")]
33-
#[deprecated(since = "TBD", note = "replaced by the `RADIX` associated constant on `f32`")]
33+
#[deprecated(since = "1.93.0", note = "replaced by the `RADIX` associated constant on `f32`")]
3434
#[rustc_diagnostic_item = "f32_legacy_const_radix"]
3535
pub const RADIX: u32 = f32::RADIX;
3636

@@ -41,15 +41,15 @@ pub const RADIX: u32 = f32::RADIX;
4141
///
4242
/// ```rust
4343
/// // deprecated way
44-
/// # #[allow(deprecated, deprecated_in_future)]
44+
/// # #[allow(deprecated)]
4545
/// let d = std::f32::MANTISSA_DIGITS;
4646
///
4747
/// // intended way
4848
/// let d = f32::MANTISSA_DIGITS;
4949
/// ```
5050
#[stable(feature = "rust1", since = "1.0.0")]
5151
#[deprecated(
52-
since = "TBD",
52+
since = "1.93.0",
5353
note = "replaced by the `MANTISSA_DIGITS` associated constant on `f32`"
5454
)]
5555
#[rustc_diagnostic_item = "f32_legacy_const_mantissa_dig"]
@@ -62,14 +62,14 @@ pub const MANTISSA_DIGITS: u32 = f32::MANTISSA_DIGITS;
6262
///
6363
/// ```rust
6464
/// // deprecated way
65-
/// # #[allow(deprecated, deprecated_in_future)]
65+
/// # #[allow(deprecated)]
6666
/// let d = std::f32::DIGITS;
6767
///
6868
/// // intended way
6969
/// let d = f32::DIGITS;
7070
/// ```
7171
#[stable(feature = "rust1", since = "1.0.0")]
72-
#[deprecated(since = "TBD", note = "replaced by the `DIGITS` associated constant on `f32`")]
72+
#[deprecated(since = "1.93.0", note = "replaced by the `DIGITS` associated constant on `f32`")]
7373
#[rustc_diagnostic_item = "f32_legacy_const_digits"]
7474
pub const DIGITS: u32 = f32::DIGITS;
7575

@@ -84,14 +84,14 @@ pub const DIGITS: u32 = f32::DIGITS;
8484
///
8585
/// ```rust
8686
/// // deprecated way
87-
/// # #[allow(deprecated, deprecated_in_future)]
87+
/// # #[allow(deprecated)]
8888
/// let e = std::f32::EPSILON;
8989
///
9090
/// // intended way
9191
/// let e = f32::EPSILON;
9292
/// ```
9393
#[stable(feature = "rust1", since = "1.0.0")]
94-
#[deprecated(since = "TBD", note = "replaced by the `EPSILON` associated constant on `f32`")]
94+
#[deprecated(since = "1.93.0", note = "replaced by the `EPSILON` associated constant on `f32`")]
9595
#[rustc_diagnostic_item = "f32_legacy_const_epsilon"]
9696
pub const EPSILON: f32 = f32::EPSILON;
9797

@@ -102,14 +102,14 @@ pub const EPSILON: f32 = f32::EPSILON;
102102
///
103103
/// ```rust
104104
/// // deprecated way
105-
/// # #[allow(deprecated, deprecated_in_future)]
105+
/// # #[allow(deprecated)]
106106
/// let min = std::f32::MIN;
107107
///
108108
/// // intended way
109109
/// let min = f32::MIN;
110110
/// ```
111111
#[stable(feature = "rust1", since = "1.0.0")]
112-
#[deprecated(since = "TBD", note = "replaced by the `MIN` associated constant on `f32`")]
112+
#[deprecated(since = "1.93.0", note = "replaced by the `MIN` associated constant on `f32`")]
113113
#[rustc_diagnostic_item = "f32_legacy_const_min"]
114114
pub const MIN: f32 = f32::MIN;
115115

@@ -120,14 +120,17 @@ pub const MIN: f32 = f32::MIN;
120120
///
121121
/// ```rust
122122
/// // deprecated way
123-
/// # #[allow(deprecated, deprecated_in_future)]
123+
/// # #[allow(deprecated)]
124124
/// let min = std::f32::MIN_POSITIVE;
125125
///
126126
/// // intended way
127127
/// let min = f32::MIN_POSITIVE;
128128
/// ```
129129
#[stable(feature = "rust1", since = "1.0.0")]
130-
#[deprecated(since = "TBD", note = "replaced by the `MIN_POSITIVE` associated constant on `f32`")]
130+
#[deprecated(
131+
since = "1.93.0",
132+
note = "replaced by the `MIN_POSITIVE` associated constant on `f32`"
133+
)]
131134
#[rustc_diagnostic_item = "f32_legacy_const_min_positive"]
132135
pub const MIN_POSITIVE: f32 = f32::MIN_POSITIVE;
133136

@@ -138,14 +141,14 @@ pub const MIN_POSITIVE: f32 = f32::MIN_POSITIVE;
138141
///
139142
/// ```rust
140143
/// // deprecated way
141-
/// # #[allow(deprecated, deprecated_in_future)]
144+
/// # #[allow(deprecated)]
142145
/// let max = std::f32::MAX;
143146
///
144147
/// // intended way
145148
/// let max = f32::MAX;
146149
/// ```
147150
#[stable(feature = "rust1", since = "1.0.0")]
148-
#[deprecated(since = "TBD", note = "replaced by the `MAX` associated constant on `f32`")]
151+
#[deprecated(since = "1.93.0", note = "replaced by the `MAX` associated constant on `f32`")]
149152
#[rustc_diagnostic_item = "f32_legacy_const_max"]
150153
pub const MAX: f32 = f32::MAX;
151154

@@ -156,14 +159,14 @@ pub const MAX: f32 = f32::MAX;
156159
///
157160
/// ```rust
158161
/// // deprecated way
159-
/// # #[allow(deprecated, deprecated_in_future)]
162+
/// # #[allow(deprecated)]
160163
/// let min = std::f32::MIN_EXP;
161164
///
162165
/// // intended way
163166
/// let min = f32::MIN_EXP;
164167
/// ```
165168
#[stable(feature = "rust1", since = "1.0.0")]
166-
#[deprecated(since = "TBD", note = "replaced by the `MIN_EXP` associated constant on `f32`")]
169+
#[deprecated(since = "1.93.0", note = "replaced by the `MIN_EXP` associated constant on `f32`")]
167170
#[rustc_diagnostic_item = "f32_legacy_const_min_exp"]
168171
pub const MIN_EXP: i32 = f32::MIN_EXP;
169172

@@ -174,14 +177,14 @@ pub const MIN_EXP: i32 = f32::MIN_EXP;
174177
///
175178
/// ```rust
176179
/// // deprecated way
177-
/// # #[allow(deprecated, deprecated_in_future)]
180+
/// # #[allow(deprecated)]
178181
/// let max = std::f32::MAX_EXP;
179182
///
180183
/// // intended way
181184
/// let max = f32::MAX_EXP;
182185
/// ```
183186
#[stable(feature = "rust1", since = "1.0.0")]
184-
#[deprecated(since = "TBD", note = "replaced by the `MAX_EXP` associated constant on `f32`")]
187+
#[deprecated(since = "1.93.0", note = "replaced by the `MAX_EXP` associated constant on `f32`")]
185188
#[rustc_diagnostic_item = "f32_legacy_const_max_exp"]
186189
pub const MAX_EXP: i32 = f32::MAX_EXP;
187190

@@ -192,14 +195,14 @@ pub const MAX_EXP: i32 = f32::MAX_EXP;
192195
///
193196
/// ```rust
194197
/// // deprecated way
195-
/// # #[allow(deprecated, deprecated_in_future)]
198+
/// # #[allow(deprecated)]
196199
/// let min = std::f32::MIN_10_EXP;
197200
///
198201
/// // intended way
199202
/// let min = f32::MIN_10_EXP;
200203
/// ```
201204
#[stable(feature = "rust1", since = "1.0.0")]
202-
#[deprecated(since = "TBD", note = "replaced by the `MIN_10_EXP` associated constant on `f32`")]
205+
#[deprecated(since = "1.93.0", note = "replaced by the `MIN_10_EXP` associated constant on `f32`")]
203206
#[rustc_diagnostic_item = "f32_legacy_const_min_10_exp"]
204207
pub const MIN_10_EXP: i32 = f32::MIN_10_EXP;
205208

@@ -210,14 +213,14 @@ pub const MIN_10_EXP: i32 = f32::MIN_10_EXP;
210213
///
211214
/// ```rust
212215
/// // deprecated way
213-
/// # #[allow(deprecated, deprecated_in_future)]
216+
/// # #[allow(deprecated)]
214217
/// let max = std::f32::MAX_10_EXP;
215218
///
216219
/// // intended way
217220
/// let max = f32::MAX_10_EXP;
218221
/// ```
219222
#[stable(feature = "rust1", since = "1.0.0")]
220-
#[deprecated(since = "TBD", note = "replaced by the `MAX_10_EXP` associated constant on `f32`")]
223+
#[deprecated(since = "1.93.0", note = "replaced by the `MAX_10_EXP` associated constant on `f32`")]
221224
#[rustc_diagnostic_item = "f32_legacy_const_max_10_exp"]
222225
pub const MAX_10_EXP: i32 = f32::MAX_10_EXP;
223226

@@ -228,14 +231,14 @@ pub const MAX_10_EXP: i32 = f32::MAX_10_EXP;
228231
///
229232
/// ```rust
230233
/// // deprecated way
231-
/// # #[allow(deprecated, deprecated_in_future)]
234+
/// # #[allow(deprecated)]
232235
/// let nan = std::f32::NAN;
233236
///
234237
/// // intended way
235238
/// let nan = f32::NAN;
236239
/// ```
237240
#[stable(feature = "rust1", since = "1.0.0")]
238-
#[deprecated(since = "TBD", note = "replaced by the `NAN` associated constant on `f32`")]
241+
#[deprecated(since = "1.93.0", note = "replaced by the `NAN` associated constant on `f32`")]
239242
#[rustc_diagnostic_item = "f32_legacy_const_nan"]
240243
pub const NAN: f32 = f32::NAN;
241244

@@ -246,14 +249,14 @@ pub const NAN: f32 = f32::NAN;
246249
///
247250
/// ```rust
248251
/// // deprecated way
249-
/// # #[allow(deprecated, deprecated_in_future)]
252+
/// # #[allow(deprecated)]
250253
/// let inf = std::f32::INFINITY;
251254
///
252255
/// // intended way
253256
/// let inf = f32::INFINITY;
254257
/// ```
255258
#[stable(feature = "rust1", since = "1.0.0")]
256-
#[deprecated(since = "TBD", note = "replaced by the `INFINITY` associated constant on `f32`")]
259+
#[deprecated(since = "1.93.0", note = "replaced by the `INFINITY` associated constant on `f32`")]
257260
#[rustc_diagnostic_item = "f32_legacy_const_infinity"]
258261
pub const INFINITY: f32 = f32::INFINITY;
259262

@@ -264,14 +267,17 @@ pub const INFINITY: f32 = f32::INFINITY;
264267
///
265268
/// ```rust
266269
/// // deprecated way
267-
/// # #[allow(deprecated, deprecated_in_future)]
270+
/// # #[allow(deprecated)]
268271
/// let ninf = std::f32::NEG_INFINITY;
269272
///
270273
/// // intended way
271274
/// let ninf = f32::NEG_INFINITY;
272275
/// ```
273276
#[stable(feature = "rust1", since = "1.0.0")]
274-
#[deprecated(since = "TBD", note = "replaced by the `NEG_INFINITY` associated constant on `f32`")]
277+
#[deprecated(
278+
since = "1.93.0",
279+
note = "replaced by the `NEG_INFINITY` associated constant on `f32`"
280+
)]
275281
#[rustc_diagnostic_item = "f32_legacy_const_neg_infinity"]
276282
pub const NEG_INFINITY: f32 = f32::NEG_INFINITY;
277283

0 commit comments

Comments
 (0)