Stabilize assoc_int_consts

This commit is contained in:
Linus Färnstrand 2020-02-04 18:01:11 +01:00
parent 2ed25f0697
commit 271ba5a3ea
5 changed files with 32 additions and 38 deletions

View file

@ -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]

View file

@ -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`.

View file

@ -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`.

View file

@ -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;
}

View file

@ -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)]