Skip to content

Remove redundant stability from enum variants #100546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions library/alloc/src/borrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@ where
B: ToOwned,
{
/// Borrowed data.
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, stable(feature = "rust1", since = "1.0.0"))]
Borrowed(#[stable(feature = "rust1", since = "1.0.0")] &'a B),

/// Owned data.
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, stable(feature = "rust1", since = "1.0.0"))]
Owned(#[stable(feature = "rust1", since = "1.0.0")] <B as ToOwned>::Owned),
}

Expand Down
4 changes: 2 additions & 2 deletions library/alloc/src/collections/btree/map/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ pub enum Entry<
#[unstable(feature = "allocator_api", issue = "32838")] A: Allocator + Clone = Global,
> {
/// A vacant entry.
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, stable(feature = "rust1", since = "1.0.0"))]
Vacant(#[stable(feature = "rust1", since = "1.0.0")] VacantEntry<'a, K, V, A>),

/// An occupied entry.
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, stable(feature = "rust1", since = "1.0.0"))]
Occupied(#[stable(feature = "rust1", since = "1.0.0")] OccupiedEntry<'a, K, V, A>),
}

Expand Down
6 changes: 3 additions & 3 deletions library/core/src/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,13 @@ pub struct AssertParamIsEq<T: Eq + ?Sized> {
#[repr(i8)]
pub enum Ordering {
/// An ordering where a compared value is less than another.
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, stable(feature = "rust1", since = "1.0.0"))]
Less = -1,
/// An ordering where a compared value is equal to another.
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, stable(feature = "rust1", since = "1.0.0"))]
Equal = 0,
/// An ordering where a compared value is greater than another.
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, stable(feature = "rust1", since = "1.0.0"))]
Greater = 1,
}

Expand Down
6 changes: 3 additions & 3 deletions library/core/src/fmt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ mod num;
/// Possible alignments returned by `Formatter::align`
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum Alignment {
#[stable(feature = "fmt_flags_align", since = "1.28.0")]
#[cfg_attr(bootstrap, stable(feature = "fmt_flags_align", since = "1.28.0"))]
/// Indication that contents should be left-aligned.
Left,
#[stable(feature = "fmt_flags_align", since = "1.28.0")]
#[cfg_attr(bootstrap, stable(feature = "fmt_flags_align", since = "1.28.0"))]
/// Indication that contents should be right-aligned.
Right,
#[stable(feature = "fmt_flags_align", since = "1.28.0")]
#[cfg_attr(bootstrap, stable(feature = "fmt_flags_align", since = "1.28.0"))]
/// Indication that contents should be center-aligned.
Center,
}
Expand Down
10 changes: 5 additions & 5 deletions library/core/src/num/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pub enum IntErrorKind {
/// Value being parsed is empty.
///
/// This variant will be constructed when parsing an empty string.
#[stable(feature = "int_error_matching", since = "1.55.0")]
#[cfg_attr(bootstrap, stable(feature = "int_error_matching", since = "1.55.0"))]
Empty,
/// Contains an invalid digit in its context.
///
Expand All @@ -97,19 +97,19 @@ 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.55.0")]
#[cfg_attr(bootstrap, stable(feature = "int_error_matching", since = "1.55.0"))]
InvalidDigit,
/// Integer is too large to store in target integer type.
#[stable(feature = "int_error_matching", since = "1.55.0")]
#[cfg_attr(bootstrap, stable(feature = "int_error_matching", since = "1.55.0"))]
PosOverflow,
/// Integer is too small to store in target integer type.
#[stable(feature = "int_error_matching", since = "1.55.0")]
#[cfg_attr(bootstrap, stable(feature = "int_error_matching", since = "1.55.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.55.0")]
#[cfg_attr(bootstrap, stable(feature = "int_error_matching", since = "1.55.0"))]
Zero,
}

Expand Down
10 changes: 5 additions & 5 deletions library/core/src/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -946,18 +946,18 @@ pub enum FpCategory {
///
/// See [the documentation for `f32`](f32) for more information on the unusual properties
/// of NaN.
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, stable(feature = "rust1", since = "1.0.0"))]
Nan,

/// Positive or negative infinity, which often results from dividing a nonzero number
/// by zero.
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, stable(feature = "rust1", since = "1.0.0"))]
Infinite,

/// Positive or negative zero.
///
/// See [the documentation for `f32`](f32) for more information on the signedness of zeroes.
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, stable(feature = "rust1", since = "1.0.0"))]
Zero,

/// “Subnormal” or “denormal” floating point representation (less precise, relative to
Expand All @@ -968,7 +968,7 @@ pub enum FpCategory {
///
/// [`Normal`]: Self::Normal
/// [`Zero`]: Self::Zero
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, stable(feature = "rust1", since = "1.0.0"))]
Subnormal,

/// A regular floating point number, not any of the exceptional categories.
Expand All @@ -977,7 +977,7 @@ pub enum FpCategory {
/// and the largest positive normal numbers are [`f32::MAX`] and [`f64::MAX`]. (Unlike signed
/// integers, floating point numbers are symmetric in their range, so negating any of these
/// constants will produce their negative counterpart.)
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, stable(feature = "rust1", since = "1.0.0"))]
Normal,
}

Expand Down
4 changes: 2 additions & 2 deletions library/core/src/ops/control_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ use crate::{convert, ops};
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum ControlFlow<B, C = ()> {
/// Move on to the next phase of the operation as normal.
#[stable(feature = "control_flow_enum_type", since = "1.55.0")]
#[cfg_attr(bootstrap, stable(feature = "control_flow_enum_type", since = "1.55.0"))]
#[lang = "Continue"]
Continue(C),
/// Exit the operation without running subsequent phases.
#[stable(feature = "control_flow_enum_type", since = "1.55.0")]
#[cfg_attr(bootstrap, stable(feature = "control_flow_enum_type", since = "1.55.0"))]
#[lang = "Break"]
Break(B),
// Yes, the order of the variants doesn't match the type parameters.
Expand Down
6 changes: 3 additions & 3 deletions library/core/src/ops/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -664,13 +664,13 @@ impl<Idx: PartialOrd<Idx>> RangeToInclusive<Idx> {
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
pub enum Bound<T> {
/// An inclusive bound.
#[stable(feature = "collections_bound", since = "1.17.0")]
#[cfg_attr(bootstrap, stable(feature = "collections_bound", since = "1.17.0"))]
Included(#[stable(feature = "collections_bound", since = "1.17.0")] T),
/// An exclusive bound.
#[stable(feature = "collections_bound", since = "1.17.0")]
#[cfg_attr(bootstrap, stable(feature = "collections_bound", since = "1.17.0"))]
Excluded(#[stable(feature = "collections_bound", since = "1.17.0")] T),
/// An infinite endpoint. Indicates that there is no bound in this direction.
#[stable(feature = "collections_bound", since = "1.17.0")]
#[cfg_attr(bootstrap, stable(feature = "collections_bound", since = "1.17.0"))]
Unbounded,
}

Expand Down
4 changes: 2 additions & 2 deletions library/core/src/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,11 +518,11 @@ use crate::{
pub enum Option<T> {
/// No value.
#[lang = "None"]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, stable(feature = "rust1", since = "1.0.0"))]
None,
/// Some value of type `T`.
#[lang = "Some"]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, stable(feature = "rust1", since = "1.0.0"))]
Some(#[stable(feature = "rust1", since = "1.0.0")] T),
}

Expand Down
4 changes: 2 additions & 2 deletions library/core/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,12 +504,12 @@ use crate::{convert, fmt, hint};
pub enum Result<T, E> {
/// Contains the success value
#[lang = "Ok"]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, stable(feature = "rust1", since = "1.0.0"))]
Ok(#[stable(feature = "rust1", since = "1.0.0")] T),

/// Contains the error value
#[lang = "Err"]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, stable(feature = "rust1", since = "1.0.0"))]
Err(#[stable(feature = "rust1", since = "1.0.0")] E),
}

Expand Down
10 changes: 5 additions & 5 deletions library/core/src/sync/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ pub enum Ordering {
/// Corresponds to [`memory_order_relaxed`] in C++20.
///
/// [`memory_order_relaxed`]: https://en.cppreference.com/w/cpp/atomic/memory_order#Relaxed_ordering
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, stable(feature = "rust1", since = "1.0.0"))]
Relaxed,
/// When coupled with a store, all previous operations become ordered
/// before any load of this value with [`Acquire`] (or stronger) ordering.
Expand All @@ -233,7 +233,7 @@ pub enum Ordering {
/// Corresponds to [`memory_order_release`] in C++20.
///
/// [`memory_order_release`]: https://en.cppreference.com/w/cpp/atomic/memory_order#Release-Acquire_ordering
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, stable(feature = "rust1", since = "1.0.0"))]
Release,
/// When coupled with a load, if the loaded value was written by a store operation with
/// [`Release`] (or stronger) ordering, then all subsequent operations
Expand All @@ -248,7 +248,7 @@ pub enum Ordering {
/// Corresponds to [`memory_order_acquire`] in C++20.
///
/// [`memory_order_acquire`]: https://en.cppreference.com/w/cpp/atomic/memory_order#Release-Acquire_ordering
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, stable(feature = "rust1", since = "1.0.0"))]
Acquire,
/// Has the effects of both [`Acquire`] and [`Release`] together:
/// For loads it uses [`Acquire`] ordering. For stores it uses the [`Release`] ordering.
Expand All @@ -262,7 +262,7 @@ pub enum Ordering {
/// Corresponds to [`memory_order_acq_rel`] in C++20.
///
/// [`memory_order_acq_rel`]: https://en.cppreference.com/w/cpp/atomic/memory_order#Release-Acquire_ordering
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, stable(feature = "rust1", since = "1.0.0"))]
AcqRel,
/// Like [`Acquire`]/[`Release`]/[`AcqRel`] (for load, store, and load-with-store
/// operations, respectively) with the additional guarantee that all threads see all
Expand All @@ -271,7 +271,7 @@ pub enum Ordering {
/// Corresponds to [`memory_order_seq_cst`] in C++20.
///
/// [`memory_order_seq_cst`]: https://en.cppreference.com/w/cpp/atomic/memory_order#Sequentially-consistent_ordering
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, stable(feature = "rust1", since = "1.0.0"))]
SeqCst,
}

Expand Down
4 changes: 2 additions & 2 deletions library/core/src/task/poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::task::Ready;
pub enum Poll<T> {
/// Represents that a value is immediately ready.
#[lang = "Ready"]
#[stable(feature = "futures_api", since = "1.36.0")]
#[cfg_attr(bootstrap, stable(feature = "futures_api", since = "1.36.0"))]
Ready(#[stable(feature = "futures_api", since = "1.36.0")] T),

/// Represents that a value is not ready yet.
Expand All @@ -22,7 +22,7 @@ pub enum Poll<T> {
/// ensure that the current task is scheduled to be awoken when
/// progress can be made.
#[lang = "Pending"]
#[stable(feature = "futures_api", since = "1.36.0")]
#[cfg_attr(bootstrap, stable(feature = "futures_api", since = "1.36.0"))]
Pending,
}

Expand Down
6 changes: 3 additions & 3 deletions library/std/src/backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ pub struct Backtrace {
pub enum BacktraceStatus {
/// Capturing a backtrace is not supported, likely because it's not
/// implemented for the current platform.
#[stable(feature = "backtrace", since = "1.65.0")]
#[cfg_attr(bootstrap, stable(feature = "backtrace", since = "1.65.0"))]
Unsupported,
/// Capturing a backtrace has been disabled through either the
/// `RUST_LIB_BACKTRACE` or `RUST_BACKTRACE` environment variables.
#[stable(feature = "backtrace", since = "1.65.0")]
#[cfg_attr(bootstrap, stable(feature = "backtrace", since = "1.65.0"))]
Disabled,
/// A backtrace has been captured and the `Backtrace` should print
/// reasonable information when rendered.
#[stable(feature = "backtrace", since = "1.65.0")]
#[cfg_attr(bootstrap, stable(feature = "backtrace", since = "1.65.0"))]
Captured,
}

Expand Down
4 changes: 2 additions & 2 deletions library/std/src/collections/hash/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2074,11 +2074,11 @@ impl<K, V, S> Debug for RawEntryBuilder<'_, K, V, S> {
#[cfg_attr(not(test), rustc_diagnostic_item = "HashMapEntry")]
pub enum Entry<'a, K: 'a, V: 'a> {
/// An occupied entry.
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, stable(feature = "rust1", since = "1.0.0"))]
Occupied(#[stable(feature = "rust1", since = "1.0.0")] OccupiedEntry<'a, K, V>),

/// A vacant entry.
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, stable(feature = "rust1", since = "1.0.0"))]
Vacant(#[stable(feature = "rust1", since = "1.0.0")] VacantEntry<'a, K, V>),
}

Expand Down
4 changes: 2 additions & 2 deletions library/std/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,13 @@ fn _var_os(key: &OsStr) -> Option<OsString> {
pub enum VarError {
/// The specified environment variable was not present in the current
/// process's environment.
#[stable(feature = "env", since = "1.0.0")]
#[cfg_attr(bootstrap, stable(feature = "env", since = "1.0.0"))]
NotPresent,

/// The specified environment variable was found, but it did not contain
/// valid unicode data. The found data is returned as a payload of this
/// variant.
#[stable(feature = "env", since = "1.0.0")]
#[cfg_attr(bootstrap, stable(feature = "env", since = "1.0.0"))]
NotUnicode(#[stable(feature = "env", since = "1.0.0")] OsString),
}

Expand Down
Loading