about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-10-23 08:18:19 +0100
committerRalf Jung <post@ralfj.de>2024-10-23 09:14:43 +0100
commite82bca6f32bd74e018c8bd46fe33986eae514189 (patch)
treed1200d3032689eef799d045c8a71d9040686077b
parent6ad17bd30c68c90792cb0e4fca8208be41493f6b (diff)
downloadrust-e82bca6f32bd74e018c8bd46fe33986eae514189.tar.gz
rust-e82bca6f32bd74e018c8bd46fe33986eae514189.zip
remove no longer needd UnstableFeature type
-rw-r--r--compiler/rustc_expand/src/config.rs2
-rw-r--r--compiler/rustc_feature/src/lib.rs4
-rw-r--r--compiler/rustc_feature/src/unstable.rs16
-rw-r--r--compiler/rustc_query_system/src/ich/impls_syntax.rs2
4 files changed, 9 insertions, 15 deletions
diff --git a/compiler/rustc_expand/src/config.rs b/compiler/rustc_expand/src/config.rs
index 7546c830a0b..af27077f242 100644
--- a/compiler/rustc_expand/src/config.rs
+++ b/compiler/rustc_expand/src/config.rs
@@ -103,7 +103,7 @@ pub fn features(sess: &Session, krate_attrs: &[Attribute], crate_name: Symbol) -
             }
 
             // If the enabled feature is unstable, record it.
-            if UNSTABLE_FEATURES.iter().find(|f| name == f.feature.name).is_some() {
+            if UNSTABLE_FEATURES.iter().find(|f| name == f.name).is_some() {
                 // When the ICE comes from core, alloc or std (approximation of the standard
                 // library), there's a chance that the person hitting the ICE may be using
                 // -Zbuild-std or similar with an untested target. The bug is probably in the
diff --git a/compiler/rustc_feature/src/lib.rs b/compiler/rustc_feature/src/lib.rs
index 8f4c0b0ac95..7c4996c1412 100644
--- a/compiler/rustc_feature/src/lib.rs
+++ b/compiler/rustc_feature/src/lib.rs
@@ -94,8 +94,8 @@ impl UnstableFeatures {
 
 fn find_lang_feature_issue(feature: Symbol) -> Option<NonZero<u32>> {
     // Search in all the feature lists.
-    if let Some(f) = UNSTABLE_FEATURES.iter().find(|f| f.feature.name == feature) {
-        return f.feature.issue;
+    if let Some(f) = UNSTABLE_FEATURES.iter().find(|f| f.name == feature) {
+        return f.issue;
     }
     if let Some(f) = ACCEPTED_FEATURES.iter().find(|f| f.name == feature) {
         return f.issue;
diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs
index 93e91c0984c..9c6de079e2f 100644
--- a/compiler/rustc_feature/src/unstable.rs
+++ b/compiler/rustc_feature/src/unstable.rs
@@ -6,10 +6,6 @@ use rustc_span::symbol::{Symbol, sym};
 
 use super::{Feature, to_nonzero};
 
-pub struct UnstableFeature {
-    pub feature: Feature,
-}
-
 #[derive(PartialEq)]
 enum FeatureStatus {
     Default,
@@ -82,13 +78,11 @@ macro_rules! declare_features {
     )+) => {
         /// Unstable language features that are being implemented or being
         /// considered for acceptance (stabilization) or removal.
-        pub const UNSTABLE_FEATURES: &[UnstableFeature] = &[
-            $(UnstableFeature {
-                feature: Feature {
-                    name: sym::$feature,
-                    since: $ver,
-                    issue: to_nonzero($issue),
-                },
+        pub const UNSTABLE_FEATURES: &[Feature] = &[
+            $(Feature {
+                name: sym::$feature,
+                since: $ver,
+                issue: to_nonzero($issue),
             }),+
         ];
 
diff --git a/compiler/rustc_query_system/src/ich/impls_syntax.rs b/compiler/rustc_query_system/src/ich/impls_syntax.rs
index 68b16a12910..52dd336313a 100644
--- a/compiler/rustc_query_system/src/ich/impls_syntax.rs
+++ b/compiler/rustc_query_system/src/ich/impls_syntax.rs
@@ -117,7 +117,7 @@ impl<'tcx> HashStable<StableHashingContext<'tcx>> for rustc_feature::Features {
 
         // FIXME: why do we hash something that is a compile-time constant?
         for feature in rustc_feature::UNSTABLE_FEATURES.iter() {
-            feature.feature.name.hash_stable(hcx, hasher);
+            feature.name.hash_stable(hcx, hasher);
         }
     }
 }