]> git.lizzy.rs Git - rust.git/blobdiff - src/libcore/num/mod.rs
Rollup merge of #44562 - eddyb:ugh-rustdoc, r=nikomatsakis
[rust.git] / src / libcore / num / mod.rs
index d533310625e5946cc6bcefad3a99e8bb6a1d49ec..bf31deae7a62576330f198c04ee8f62cb973a4a7 100644 (file)
@@ -109,6 +109,7 @@ macro_rules! int_impl {
         /// assert_eq!(i8::min_value(), -128);
         /// ```
         #[stable(feature = "rust1", since = "1.0.0")]
+        #[cfg_attr(not(stage0), rustc_const_unstable(feature = "const_min_value"))]
         #[inline]
         pub const fn min_value() -> Self {
             !0 ^ ((!0 as $UnsignedT) >> 1) as Self
@@ -122,6 +123,7 @@ pub const fn min_value() -> Self {
         /// assert_eq!(i8::max_value(), 127);
         /// ```
         #[stable(feature = "rust1", since = "1.0.0")]
+        #[cfg_attr(not(stage0), rustc_const_unstable(feature = "const_max_value"))]
         #[inline]
         pub const fn max_value() -> Self {
             !Self::min_value()
@@ -131,6 +133,10 @@ pub const fn max_value() -> Self {
         ///
         /// Leading and trailing whitespace represent an error.
         ///
+        /// # Panics
+        ///
+        /// This function panics if `radix` is not in the range from 2 to 36.
+        ///
         /// # Examples
         ///
         /// Basic usage:
@@ -1276,6 +1282,7 @@ macro_rules! uint_impl {
         /// assert_eq!(u8::min_value(), 0);
         /// ```
         #[stable(feature = "rust1", since = "1.0.0")]
+        #[cfg_attr(not(stage0), rustc_const_unstable(feature = "const_min_value"))]
         #[inline]
         pub const fn min_value() -> Self { 0 }
 
@@ -1287,6 +1294,7 @@ pub const fn min_value() -> Self { 0 }
         /// assert_eq!(u8::max_value(), 255);
         /// ```
         #[stable(feature = "rust1", since = "1.0.0")]
+        #[cfg_attr(not(stage0), rustc_const_unstable(feature = "const_max_value"))]
         #[inline]
         pub const fn max_value() -> Self { !0 }