about summary refs log tree commit diff
path: root/compiler/rustc_feature/src/builtin_attrs.rs
diff options
context:
space:
mode:
authormejrs <59372212+mejrs@users.noreply.github.com>2025-06-06 11:11:42 +0200
committermejrs <59372212+mejrs@users.noreply.github.com>2025-06-09 11:44:52 +0200
commit81eb182a02770922ce8513545c976004984a42ec (patch)
tree906378c38b5f8e62e1e26946abd7e324e5cde8a6 /compiler/rustc_feature/src/builtin_attrs.rs
parent959d6de1a928061256bb845025597be11ddca2ea (diff)
downloadrust-81eb182a02770922ce8513545c976004984a42ec.tar.gz
rust-81eb182a02770922ce8513545c976004984a42ec.zip
Remove rustc_feature::Stability
Diffstat (limited to 'compiler/rustc_feature/src/builtin_attrs.rs')
-rw-r--r--compiler/rustc_feature/src/builtin_attrs.rs19
1 files changed, 1 insertions, 18 deletions
diff --git a/compiler/rustc_feature/src/builtin_attrs.rs b/compiler/rustc_feature/src/builtin_attrs.rs
index aceaa2e5ab9..73a21789c5d 100644
--- a/compiler/rustc_feature/src/builtin_attrs.rs
+++ b/compiler/rustc_feature/src/builtin_attrs.rs
@@ -9,7 +9,7 @@ use rustc_data_structures::fx::FxHashMap;
 use rustc_span::edition::Edition;
 use rustc_span::{Symbol, sym};
 
-use crate::{Features, Stability};
+use crate::Features;
 
 type GateFn = fn(&Features) -> bool;
 
@@ -98,7 +98,6 @@ pub enum AttributeSafety {
 pub enum AttributeGate {
     /// A gated attribute which requires a feature gate to be enabled.
     Gated {
-        stability: Stability,
         /// The feature gate, for example `#![feature(rustc_attrs)]` for rustc_* attributes.
         feature: Symbol,
         /// The error message displayed when an attempt is made to use the attribute without its feature gate.
@@ -112,12 +111,6 @@ pub enum AttributeGate {
     Ungated,
 }
 
-impl AttributeGate {
-    fn is_deprecated(&self) -> bool {
-        matches!(*self, Self::Gated { stability: Stability::Deprecated(_, _), .. })
-    }
-}
-
 /// A template that the attribute input must match.
 /// Only top-level shape (`#[attr]` vs `#[attr(...)]` vs `#[attr = ...]`) is considered now.
 #[derive(Clone, Copy, Default)]
@@ -252,7 +245,6 @@ macro_rules! gated {
             template: $tpl,
             duplicates: $duplicates,
             gate: Gated {
-                stability: Stability::Unstable,
                 feature: sym::$gate,
                 message: $message,
                 check: Features::$gate,
@@ -269,7 +261,6 @@ macro_rules! gated {
             template: $tpl,
             duplicates: $duplicates,
             gate: Gated {
-                stability: Stability::Unstable,
                 feature: sym::$attr,
                 message: $message,
                 check: Features::$attr,
@@ -286,7 +277,6 @@ macro_rules! gated {
             template: $tpl,
             duplicates: $duplicates,
             gate: Gated {
-                stability: Stability::Unstable,
                 feature: sym::$gate,
                 message: $message,
                 check: Features::$gate,
@@ -303,7 +293,6 @@ macro_rules! gated {
             template: $tpl,
             duplicates: $duplicates,
             gate: Gated {
-                stability: Stability::Unstable,
                 feature: sym::$attr,
                 message: $message,
                 check: Features::$attr,
@@ -337,7 +326,6 @@ macro_rules! rustc_attr {
             template: $tpl,
             duplicates: $duplicates,
             gate: Gated {
-                stability: Stability::Unstable,
                 feature: sym::rustc_attrs,
                 message: "use of an internal attribute",
                 check: Features::rustc_attrs,
@@ -1025,7 +1013,6 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
         template: template!(NameValueStr: "name"),
         duplicates: ErrorFollowing,
         gate: Gated{
-            stability: Stability::Unstable,
             feature: sym::rustc_attrs,
             message: "use of an internal attribute",
             check: Features::rustc_attrs,
@@ -1240,10 +1227,6 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
     ),
 ];
 
-pub fn deprecated_attributes() -> Vec<&'static BuiltinAttribute> {
-    BUILTIN_ATTRIBUTES.iter().filter(|attr| attr.gate.is_deprecated()).collect()
-}
-
 pub fn is_builtin_attr_name(name: Symbol) -> bool {
     BUILTIN_ATTRIBUTE_MAP.get(&name).is_some()
 }