about summary refs log tree commit diff
path: root/compiler/rustc_feature/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-10-05 11:38:43 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2023-10-05 11:42:32 +1100
commit8ba91378401f5483b1d834be33911028507a9d5d (patch)
tree55815d643ff63175e03a02952fe7af87d4e54587 /compiler/rustc_feature/src
parent5d9559e0269d9d7db06c825d56d475757232c924 (diff)
downloadrust-8ba91378401f5483b1d834be33911028507a9d5d.tar.gz
rust-8ba91378401f5483b1d834be33911028507a9d5d.zip
Merge `STABLE_REMOVED_FEATURES` list into `REMOVED_FEATURES`.
There is a single features (`no_stack_check`) in
`STABLE_REMOVED_FEATURES`. But the treatment of
`STABLE_REMOVED_FEATURES` and `REMOVED_FEATURES` is actually identical.
So this commit just merges them, and uses a comment to record
`no_stack_check`'s unique "stable removed" status.

This also lets `State::Stabilized` (which was a terrible name) be
removed.
Diffstat (limited to 'compiler/rustc_feature/src')
-rw-r--r--compiler/rustc_feature/src/lib.rs5
-rw-r--r--compiler/rustc_feature/src/removed.rs27
2 files changed, 6 insertions, 26 deletions
diff --git a/compiler/rustc_feature/src/lib.rs b/compiler/rustc_feature/src/lib.rs
index d4dc5920bec..4721bff0ec7 100644
--- a/compiler/rustc_feature/src/lib.rs
+++ b/compiler/rustc_feature/src/lib.rs
@@ -32,7 +32,6 @@ pub enum State {
     Accepted,
     Active { set: fn(&mut Features) },
     Removed { reason: Option<&'static str> },
-    Stabilized { reason: Option<&'static str> },
 }
 
 impl fmt::Debug for State {
@@ -41,7 +40,6 @@ impl fmt::Debug for State {
             State::Accepted { .. } => write!(f, "accepted"),
             State::Active { .. } => write!(f, "active"),
             State::Removed { .. } => write!(f, "removed"),
-            State::Stabilized { .. } => write!(f, "stabilized"),
         }
     }
 }
@@ -113,7 +111,6 @@ fn find_lang_feature_issue(feature: Symbol) -> Option<NonZeroU32> {
         .chain(ACTIVE_FEATURES)
         .chain(ACCEPTED_FEATURES)
         .chain(REMOVED_FEATURES)
-        .chain(STABLE_REMOVED_FEATURES)
         .find(|t| t.name == feature);
 
     match found {
@@ -151,4 +148,4 @@ pub use builtin_attrs::{
     is_valid_for_get_attr, AttributeGate, AttributeTemplate, AttributeType, BuiltinAttribute,
     GatedCfg, BUILTIN_ATTRIBUTES, BUILTIN_ATTRIBUTE_MAP,
 };
-pub use removed::{REMOVED_FEATURES, STABLE_REMOVED_FEATURES};
+pub use removed::REMOVED_FEATURES;
diff --git a/compiler/rustc_feature/src/removed.rs b/compiler/rustc_feature/src/removed.rs
index da18cb2a239..de15deef178 100644
--- a/compiler/rustc_feature/src/removed.rs
+++ b/compiler/rustc_feature/src/removed.rs
@@ -20,23 +20,6 @@ macro_rules! declare_features {
             ),+
         ];
     };
-
-    ($(
-        $(#[doc = $doc:tt])* (stable_removed, $feature:ident, $ver:expr, $issue:expr, None),
-    )+) => {
-        /// Represents stable features which have since been removed (it was once Accepted)
-        pub const STABLE_REMOVED_FEATURES: &[Feature] = &[
-            $(
-                Feature {
-                    state: State::Stabilized { reason: None },
-                    name: sym::$feature,
-                    since: $ver,
-                    issue: to_nonzero($issue),
-                    edition: None,
-                }
-            ),+
-        ];
-    };
 }
 
 #[rustfmt::skip]
@@ -141,6 +124,11 @@ declare_features! (
     (removed, no_coverage, "CURRENT_RUSTC_VERSION", Some(84605), None, Some("renamed to `coverage_attribute`")),
     /// Allows `#[no_debug]`.
     (removed, no_debug, "1.43.0", Some(29721), None, Some("removed due to lack of demand")),
+    /// Note: this feature was previously recorded in a separate
+    /// `STABLE_REMOVED` list because it, uniquely, was once stable but was
+    /// then removed. But there was no utility storing it separately, so now
+    /// it's in this list.
+    (removed, no_stack_check, "1.0.0", None, None, None),
     /// Allows using `#[on_unimplemented(..)]` on traits.
     /// (Moved to `rustc_attrs`.)
     (removed, on_unimplemented, "1.40.0", None, None, None),
@@ -208,8 +196,3 @@ declare_features! (
     // feature-group-end: removed features
     // -------------------------------------------------------------------------
 );
-
-#[rustfmt::skip]
-declare_features! (
-    (stable_removed, no_stack_check, "1.0.0", None, None),
-);