]> git.lizzy.rs Git - rust.git/commitdiff
stabilize `int_error_matching`
authorEthan Brierley <ethanboxx@gmail.com>
Tue, 18 May 2021 09:37:28 +0000 (10:37 +0100)
committerEthan Brierley <ethanboxx@gmail.com>
Mon, 14 Jun 2021 08:58:32 +0000 (09:58 +0100)
compiler/rustc_middle/src/lib.rs
library/core/src/lib.rs
library/core/src/num/error.rs
library/core/src/num/mod.rs
library/core/tests/lib.rs
library/std/src/lib.rs
library/std/src/num.rs

index e1d7bc4be533c467fa07a833296441957abbfd49..649913dd025b5838a02d717505cceaf994a78680 100644 (file)
@@ -42,7 +42,6 @@
 #![feature(crate_visibility_modifier)]
 #![feature(associated_type_bounds)]
 #![feature(rustc_attrs)]
-#![feature(int_error_matching)]
 #![feature(half_open_range_patterns)]
 #![feature(exclusive_range_pattern)]
 #![feature(control_flow_enum)]
index 949ef27f018e4c3b89afd439cd0cba43e8e8601d..73959291481d8d1bc944700a0c4c72713497d7f6 100644 (file)
 #![feature(slice_ptr_get)]
 #![feature(no_niche)] // rust-lang/rust#68303
 #![feature(no_coverage)] // rust-lang/rust#84605
-#![feature(int_error_matching)]
 #![cfg_attr(bootstrap, feature(target_feature_11))]
 #![deny(unsafe_op_in_unsafe_fn)]
 #![deny(or_patterns_back_compat)]
index e2cc8faf8547d18157550b5621440060e38933fe..07902eec2e8f99361334859bb442515cf833ad40 100644 (file)
@@ -74,26 +74,20 @@ pub struct ParseIntError {
 /// # Example
 ///
 /// ```
-/// #![feature(int_error_matching)]
-///
 /// # fn main() {
 /// if let Err(e) = i32::from_str_radix("a12", 10) {
 ///     println!("Failed conversion to i32: {:?}", e.kind());
 /// }
 /// # }
 /// ```
-#[unstable(
-    feature = "int_error_matching",
-    reason = "it can be useful to match errors when making error messages \
-              for integer parsing",
-    issue = "22639"
-)]
+#[stable(feature = "int_error_matching", since = "1.54.0")]
 #[derive(Debug, Clone, PartialEq, Eq)]
 #[non_exhaustive]
 pub enum IntErrorKind {
     /// Value being parsed is empty.
     ///
-    /// Among other causes, this variant will be constructed when parsing an empty string.
+    /// This variant will be constructed when parsing an empty string.
+    #[stable(feature = "int_error_matching", since = "1.54.0")]
     Empty,
     /// Contains an invalid digit in its context.
     ///
@@ -102,26 +96,25 @@ pub enum IntErrorKind {
     ///
     /// This variant is also constructed when a `+` or `-` is misplaced within a string
     /// either on its own or in the middle of a number.
+    #[stable(feature = "int_error_matching", since = "1.54.0")]
     InvalidDigit,
     /// Integer is too large to store in target integer type.
+    #[stable(feature = "int_error_matching", since = "1.54.0")]
     PosOverflow,
     /// Integer is too small to store in target integer type.
+    #[stable(feature = "int_error_matching", since = "1.54.0")]
     NegOverflow,
     /// Value was Zero
     ///
     /// This variant will be emitted when the parsing string has a value of zero, which
     /// would be illegal for non-zero types.
+    #[stable(feature = "int_error_matching", since = "1.54.0")]
     Zero,
 }
 
 impl ParseIntError {
     /// Outputs the detailed cause of parsing an integer failing.
-    #[unstable(
-        feature = "int_error_matching",
-        reason = "it can be useful to match errors when making error messages \
-              for integer parsing",
-        issue = "22639"
-    )]
+    #[stable(feature = "int_error_matching", since = "1.54.0")]
     pub fn kind(&self) -> &IntErrorKind {
         &self.kind
     }
index 6032dc9a2d371c610829b79f2a4c748cee1a9c15..464f241982d4aae64ea332fd9ba3404603615c2e 100644 (file)
@@ -57,12 +57,7 @@ macro_rules! unlikely {
 #[stable(feature = "try_from", since = "1.34.0")]
 pub use error::TryFromIntError;
 
-#[unstable(
-    feature = "int_error_matching",
-    reason = "it can be useful to match errors when making error messages \
-              for integer parsing",
-    issue = "22639"
-)]
+#[stable(feature = "int_error_matching", since = "1.54.0")]
 pub use error::IntErrorKind;
 
 macro_rules! usize_isize_to_xe_bytes_doc {
index 16051b3bc36c72701cf83546a8f60cac73b5fb21..2ff1e75ab870313db8e2cf33479a7af54cc0fd93 100644 (file)
@@ -46,7 +46,6 @@
 #![feature(try_trait_v2)]
 #![feature(slice_internals)]
 #![feature(slice_partition_dedup)]
-#![feature(int_error_matching)]
 #![feature(iter_advance_by)]
 #![feature(iter_partition_in_place)]
 #![feature(iter_intersperse)]
index c4f21587457c1555591e125fe0184bf8aa7092ab..62722c9d521f4717addf03bdbd7933f8bc5a66e0 100644 (file)
 #![feature(global_asm)]
 #![feature(hashmap_internals)]
 #![feature(int_error_internals)]
-#![feature(int_error_matching)]
 #![feature(integer_atomics)]
 #![feature(into_future)]
 #![feature(intra_doc_pointers)]
index 0f1c59626859411ee501d47abe7715d19c63ff02..b08ec710305ca28aa74b37c9083bd72e44c46c65 100644 (file)
 #[stable(feature = "nonzero", since = "1.28.0")]
 pub use core::num::{NonZeroU128, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize};
 
-#[unstable(
-    feature = "int_error_matching",
-    reason = "it can be useful to match errors when making error messages \
-              for integer parsing",
-    issue = "22639"
-)]
+ #[stable(feature = "int_error_matching", since = "1.54.0")]
 pub use core::num::IntErrorKind;
 
 #[cfg(test)]