about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-10-05 16:35:50 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2023-10-05 18:01:11 +1100
commit9d4e49b386c66520eb6434405a86ef56614d84bc (patch)
treed7ce7a0b3ca424105b38cdd76106bfe9a53cdbbe
parent56fd2531ac44f95295f78b9f55383bfebc26d358 (diff)
downloadrust-9d4e49b386c66520eb6434405a86ef56614d84bc.tar.gz
rust-9d4e49b386c66520eb6434405a86ef56614d84bc.zip
Use `declared_features` to avoid two lookups.
-rw-r--r--compiler/rustc_feature/src/active.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs
index 75cb84d1b56..abfaef8b0ff 100644
--- a/compiler/rustc_feature/src/active.rs
+++ b/compiler/rustc_feature/src/active.rs
@@ -116,8 +116,7 @@ macro_rules! declare_features {
                         sym::$feature => status_to_enum!($status) == FeatureStatus::Incomplete,
                     )*
                     // accepted and removed features aren't in this file but are never incomplete
-                    _ if self.declared_lang_features.iter().any(|f| f.0 == feature) => false,
-                    _ if self.declared_lib_features.iter().any(|f| f.0 == feature) => false,
+                    _ if self.declared_features.contains(&feature) => false,
                     _ => panic!("`{}` was not listed in `declare_features`", feature),
                 }
             }
@@ -132,8 +131,7 @@ macro_rules! declare_features {
                     )*
                     // accepted and removed features aren't in this file but are never internal
                     // (a removed feature might have been internal, but it doesn't matter anymore)
-                    _ if self.declared_lang_features.iter().any(|f| f.0 == feature) => false,
-                    _ if self.declared_lib_features.iter().any(|f| f.0 == feature) => false,
+                    _ if self.declared_features.contains(&feature) => false,
                     _ => panic!("`{}` was not listed in `declare_features`", feature),
                 }
             }