Skip to content

Commit 75ed342

Browse files
committed
Auto merge of #84910 - eopb:stabilize_int_error_matching, r=yaahc
stabilize `int_error_matching` closes #22639 > It has been over half a year since #77640 (review), and the indexing question is rejected in #79728 (review), so I guess we can submit another stabilization attempt? 😉 _Originally posted by `@kennytm` in #22639 (comment)
2 parents 44f4a87 + 52a6885 commit 75ed342

File tree

7 files changed

+10
-31
lines changed

7 files changed

+10
-31
lines changed

compiler/rustc_middle/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
#![feature(crate_visibility_modifier)]
4343
#![feature(associated_type_bounds)]
4444
#![feature(rustc_attrs)]
45-
#![feature(int_error_matching)]
4645
#![feature(half_open_range_patterns)]
4746
#![feature(exclusive_range_pattern)]
4847
#![feature(control_flow_enum)]

library/core/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@
165165
#![feature(slice_ptr_get)]
166166
#![feature(no_niche)] // rust-lang/rust#68303
167167
#![feature(no_coverage)] // rust-lang/rust#84605
168-
#![feature(int_error_matching)]
169168
#![cfg_attr(bootstrap, feature(target_feature_11))]
170169
#![deny(unsafe_op_in_unsafe_fn)]
171170
#![deny(or_patterns_back_compat)]

library/core/src/num/error.rs

+8-15
Original file line numberDiff line numberDiff line change
@@ -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]
9386
pub 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

117115
impl 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
}

library/core/src/num/mod.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,7 @@ pub use nonzero::{NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, No
5757
#[stable(feature = "try_from", since = "1.34.0")]
5858
pub use error::TryFromIntError;
5959

60-
#[unstable(
61-
feature = "int_error_matching",
62-
reason = "it can be useful to match errors when making error messages \
63-
for integer parsing",
64-
issue = "22639"
65-
)]
60+
#[stable(feature = "int_error_matching", since = "1.55.0")]
6661
pub use error::IntErrorKind;
6762

6863
macro_rules! usize_isize_to_xe_bytes_doc {

library/core/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
#![feature(try_trait_v2)]
4646
#![feature(slice_internals)]
4747
#![feature(slice_partition_dedup)]
48-
#![feature(int_error_matching)]
4948
#![feature(iter_advance_by)]
5049
#![feature(iter_partition_in_place)]
5150
#![feature(iter_intersperse)]

library/std/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@
278278
#![feature(global_asm)]
279279
#![feature(hashmap_internals)]
280280
#![feature(int_error_internals)]
281-
#![feature(int_error_matching)]
282281
#![feature(integer_atomics)]
283282
#![feature(into_future)]
284283
#![feature(intra_doc_pointers)]

library/std/src/num.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,7 @@ pub use core::num::{NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8,
2222
#[stable(feature = "nonzero", since = "1.28.0")]
2323
pub use core::num::{NonZeroU128, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize};
2424

25-
#[unstable(
26-
feature = "int_error_matching",
27-
reason = "it can be useful to match errors when making error messages \
28-
for integer parsing",
29-
issue = "22639"
30-
)]
25+
#[stable(feature = "int_error_matching", since = "1.55.0")]
3126
pub use core::num::IntErrorKind;
3227

3328
#[cfg(test)]

0 commit comments

Comments
 (0)