From 271ba5a3ea59f25ebc7ba3b9a2e620a833e50b33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20F=C3=A4rnstrand?= Date: Tue, 4 Feb 2020 18:01:11 +0100 Subject: [PATCH] Stabilize assoc_int_consts --- src/libcore/lib.rs | 1 - src/libcore/num/f32.rs | 28 ++++++++++++++-------------- src/libcore/num/f64.rs | 28 ++++++++++++++-------------- src/libcore/num/mod.rs | 12 ++++-------- src/libstd/lib.rs | 1 - 5 files changed, 32 insertions(+), 38 deletions(-) diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index 12647fae9004..4c543f1173bb 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -138,7 +138,6 @@ #![feature(associated_type_bounds)] #![feature(const_type_id)] #![feature(const_caller_location)] -#![feature(assoc_int_consts)] #![cfg_attr(not(bootstrap), feature(no_niche))] // rust-lang/rust#68303 #[prelude_import] diff --git a/src/libcore/num/f32.rs b/src/libcore/num/f32.rs index da8dd9acd9f4..99df846c0952 100644 --- a/src/libcore/num/f32.rs +++ b/src/libcore/num/f32.rs @@ -154,15 +154,15 @@ pub mod consts { #[cfg(not(test))] impl f32 { /// The radix or base of the internal representation of `f32`. - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const RADIX: u32 = 2; /// Number of significant digits in base 2. - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const MANTISSA_DIGITS: u32 = 24; /// Approximate number of significant digits in base 10. - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const DIGITS: u32 = 6; /// [Machine epsilon] value for `f32`. @@ -170,41 +170,41 @@ impl f32 { /// This is the difference between `1.0` and the next larger representable number. /// /// [Machine epsilon]: https://en.wikipedia.org/wiki/Machine_epsilon - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const EPSILON: f32 = 1.19209290e-07_f32; /// Smallest finite `f32` value. - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const MIN: f32 = -3.40282347e+38_f32; /// Smallest positive normal `f32` value. - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const MIN_POSITIVE: f32 = 1.17549435e-38_f32; /// Largest finite `f32` value. - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const MAX: f32 = 3.40282347e+38_f32; /// One greater than the minimum possible normal power of 2 exponent. - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const MIN_EXP: i32 = -125; /// Maximum possible power of 2 exponent. - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const MAX_EXP: i32 = 128; /// Minimum possible normal power of 10 exponent. - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const MIN_10_EXP: i32 = -37; /// Maximum possible power of 10 exponent. - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const MAX_10_EXP: i32 = 38; /// Not a Number (NaN). - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const NAN: f32 = 0.0_f32 / 0.0_f32; /// Infinity (∞). - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const INFINITY: f32 = 1.0_f32 / 0.0_f32; /// Negative infinity (-∞). - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const NEG_INFINITY: f32 = -1.0_f32 / 0.0_f32; /// Returns `true` if this value is `NaN`. diff --git a/src/libcore/num/f64.rs b/src/libcore/num/f64.rs index a6081f184ab2..63caffc19c6f 100644 --- a/src/libcore/num/f64.rs +++ b/src/libcore/num/f64.rs @@ -154,14 +154,14 @@ pub mod consts { #[cfg(not(test))] impl f64 { /// The radix or base of the internal representation of `f64`. - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const RADIX: u32 = 2; /// Number of significant digits in base 2. - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const MANTISSA_DIGITS: u32 = 53; /// Approximate number of significant digits in base 10. - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const DIGITS: u32 = 15; /// [Machine epsilon] value for `f64`. @@ -169,41 +169,41 @@ impl f64 { /// This is the difference between `1.0` and the next larger representable number. /// /// [Machine epsilon]: https://en.wikipedia.org/wiki/Machine_epsilon - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const EPSILON: f64 = 2.2204460492503131e-16_f64; /// Smallest finite `f64` value. - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const MIN: f64 = -1.7976931348623157e+308_f64; /// Smallest positive normal `f64` value. - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const MIN_POSITIVE: f64 = 2.2250738585072014e-308_f64; /// Largest finite `f64` value. - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const MAX: f64 = 1.7976931348623157e+308_f64; /// One greater than the minimum possible normal power of 2 exponent. - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const MIN_EXP: i32 = -1021; /// Maximum possible power of 2 exponent. - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const MAX_EXP: i32 = 1024; /// Minimum possible normal power of 10 exponent. - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const MIN_10_EXP: i32 = -307; /// Maximum possible power of 10 exponent. - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const MAX_10_EXP: i32 = 308; /// Not a Number (NaN). - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const NAN: f64 = 0.0_f64 / 0.0_f64; /// Infinity (∞). - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const INFINITY: f64 = 1.0_f64 / 0.0_f64; /// Negative infinity (-∞). - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const NEG_INFINITY: f64 = -1.0_f64 / 0.0_f64; /// Returns `true` if this value is `NaN`. diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 471ab9666224..bcc38d0f0c85 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -257,11 +257,10 @@ macro_rules! int_impl { Basic usage: ``` -#![feature(assoc_int_consts)] ", $Feature, "assert_eq!(", stringify!($SelfT), "::MIN, ", stringify!($Min), ");", $EndFeature, " ```"), - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const MIN: Self = !0 ^ ((!0 as $UnsignedT) >> 1) as Self; } @@ -273,11 +272,10 @@ $EndFeature, " Basic usage: ``` -#![feature(assoc_int_consts)] ", $Feature, "assert_eq!(", stringify!($SelfT), "::MAX, ", stringify!($Max), ");", $EndFeature, " ```"), - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const MAX: Self = !Self::MIN; } @@ -2435,10 +2433,9 @@ macro_rules! uint_impl { Basic usage: ``` -#![feature(assoc_int_consts)] ", $Feature, "assert_eq!(", stringify!($SelfT), "::MIN, 0);", $EndFeature, " ```"), - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const MIN: Self = 0; } @@ -2450,11 +2447,10 @@ Basic usage: Basic usage: ``` -#![feature(assoc_int_consts)] ", $Feature, "assert_eq!(", stringify!($SelfT), "::MAX, ", stringify!($MaxV), ");", $EndFeature, " ```"), - #[unstable(feature = "assoc_int_consts", reason = "recently added", issue = "68490")] + #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const MAX: Self = !0; } diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index f9c9f224730d..50f05d0c7f9d 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -237,7 +237,6 @@ #![feature(arbitrary_self_types)] #![feature(array_error_internals)] #![feature(asm)] -#![feature(assoc_int_consts)] #![feature(associated_type_bounds)] #![feature(box_syntax)] #![feature(c_variadic)]