Skip to content

Commit 5450cc7

Browse files
committed
Deprecate MIN/MAX constants in integer modules
1 parent f5e0f4d commit 5450cc7

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/libcore/num/int_macros.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ macro_rules! int_module {
55
($T:ident, #[$attr:meta]) => (
66
/// The smallest value that can be represented by this integer type.
77
#[$attr]
8+
#[rustc_deprecated(since = "1.42.0", reason = "replaced by associated constant MIN")]
89
pub const MIN: $T = $T::min_value();
910
/// The largest value that can be represented by this integer type.
1011
#[$attr]
12+
#[rustc_deprecated(since = "1.42.0", reason = "replaced by associated constant MAX")]
1113
pub const MAX: $T = $T::max_value();
1214
)
1315
}

src/libcore/num/uint_macros.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ macro_rules! uint_module {
55
($T:ident, #[$attr:meta]) => (
66
/// The smallest value that can be represented by this integer type.
77
#[$attr]
8+
#[rustc_deprecated(since = "1.42.0", reason = "replaced by associated constant MIN")]
89
pub const MIN: $T = $T::min_value();
910
/// The largest value that can be represented by this integer type.
1011
#[$attr]
12+
#[rustc_deprecated(since = "1.42.0", reason = "replaced by associated constant MAX")]
1113
pub const MAX: $T = $T::max_value();
1214
)
1315
}

0 commit comments

Comments
 (0)