@@ -74,26 +74,20 @@ pub struct ParseIntError {
74
74
/// # Example
75
75
///
76
76
/// ```
77
- /// #![feature(int_error_matching)]
78
- ///
79
77
/// # fn main() {
80
78
/// if let Err(e) = i32::from_str_radix("a12", 10) {
81
79
/// println!("Failed conversion to i32: {:?}", e.kind());
82
80
/// }
83
81
/// # }
84
82
/// ```
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.54.0" ) ]
91
84
#[ derive( Debug , Clone , PartialEq , Eq ) ]
92
85
#[ non_exhaustive]
93
86
pub enum IntErrorKind {
94
87
/// Value being parsed is empty.
95
88
///
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.54.0" ) ]
97
91
Empty ,
98
92
/// Contains an invalid digit in its context.
99
93
///
@@ -102,26 +96,25 @@ pub enum IntErrorKind {
102
96
///
103
97
/// This variant is also constructed when a `+` or `-` is misplaced within a string
104
98
/// either on its own or in the middle of a number.
99
+ #[ stable( feature = "int_error_matching" , since = "1.54.0" ) ]
105
100
InvalidDigit ,
106
101
/// Integer is too large to store in target integer type.
102
+ #[ stable( feature = "int_error_matching" , since = "1.54.0" ) ]
107
103
PosOverflow ,
108
104
/// Integer is too small to store in target integer type.
105
+ #[ stable( feature = "int_error_matching" , since = "1.54.0" ) ]
109
106
NegOverflow ,
110
107
/// Value was Zero
111
108
///
112
109
/// This variant will be emitted when the parsing string has a value of zero, which
113
110
/// would be illegal for non-zero types.
111
+ #[ stable( feature = "int_error_matching" , since = "1.54.0" ) ]
114
112
Zero ,
115
113
}
116
114
117
115
impl ParseIntError {
118
116
/// 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.54.0" ) ]
125
118
pub fn kind ( & self ) -> & IntErrorKind {
126
119
& self . kind
127
120
}
0 commit comments