@@ -74,26 +74,20 @@ pub struct ParseIntError {
7474/// # Example
7575///
7676/// ```
77- /// #![feature(int_error_matching)]
78- ///
7977/// # fn main() {
8078/// if let Err(e) = i32::from_str_radix("a12", 10) {
8179/// println!("Failed conversion to i32: {:?}", e.kind());
8280/// }
8381/// # }
8482/// ```
85- #[ unstable(
86- feature = "int_error_matching" ,
87- reason = "it can be useful to match errors when making error messages \
88- for integer parsing",
89- issue = "22639"
90- ) ]
83+ #[ stable( feature = "int_error_matching" , since = "1.55.0" ) ]
9184#[ derive( Debug , Clone , PartialEq , Eq ) ]
9285#[ non_exhaustive]
9386pub enum IntErrorKind {
9487 /// Value being parsed is empty.
9588 ///
96- /// Among other causes, this variant will be constructed when parsing an empty string.
89+ /// This variant will be constructed when parsing an empty string.
90+ #[ stable( feature = "int_error_matching" , since = "1.55.0" ) ]
9791 Empty ,
9892 /// Contains an invalid digit in its context.
9993 ///
@@ -102,26 +96,25 @@ pub enum IntErrorKind {
10296 ///
10397 /// This variant is also constructed when a `+` or `-` is misplaced within a string
10498 /// either on its own or in the middle of a number.
99+ #[ stable( feature = "int_error_matching" , since = "1.55.0" ) ]
105100 InvalidDigit ,
106101 /// Integer is too large to store in target integer type.
102+ #[ stable( feature = "int_error_matching" , since = "1.55.0" ) ]
107103 PosOverflow ,
108104 /// Integer is too small to store in target integer type.
105+ #[ stable( feature = "int_error_matching" , since = "1.55.0" ) ]
109106 NegOverflow ,
110107 /// Value was Zero
111108 ///
112109 /// This variant will be emitted when the parsing string has a value of zero, which
113110 /// would be illegal for non-zero types.
111+ #[ stable( feature = "int_error_matching" , since = "1.55.0" ) ]
114112 Zero ,
115113}
116114
117115impl ParseIntError {
118116 /// Outputs the detailed cause of parsing an integer failing.
119- #[ unstable(
120- feature = "int_error_matching" ,
121- reason = "it can be useful to match errors when making error messages \
122- for integer parsing",
123- issue = "22639"
124- ) ]
117+ #[ stable( feature = "int_error_matching" , since = "1.55.0" ) ]
125118 pub fn kind ( & self ) -> & IntErrorKind {
126119 & self . kind
127120 }
0 commit comments