Rollup merge of #46287 - SimonSapin:stable-constness, r=aturon

Stabilize const-calling existing const-fns in std

Fixes #46038
This commit is contained in:
kennytm
2017-11-29 18:37:47 +08:00
committed by GitHub
45 changed files with 8 additions and 164 deletions

View File

@@ -110,7 +110,6 @@ macro_rules! int_impl {
/// assert_eq!(i8::min_value(), -128);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_min_value")]
#[inline]
pub const fn min_value() -> Self {
!0 ^ ((!0 as $UnsignedT) >> 1) as Self
@@ -124,7 +123,6 @@ macro_rules! int_impl {
/// assert_eq!(i8::max_value(), 127);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_max_value")]
#[inline]
pub const fn max_value() -> Self {
!Self::min_value()
@@ -1290,7 +1288,6 @@ macro_rules! uint_impl {
/// assert_eq!(u8::min_value(), 0);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_min_value")]
#[inline]
pub const fn min_value() -> Self { 0 }
@@ -1302,7 +1299,6 @@ macro_rules! uint_impl {
/// assert_eq!(u8::max_value(), 255);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_max_value")]
#[inline]
pub const fn max_value() -> Self { !0 }