Skip to content

Commit 9d4e49b

Browse files
committed
Use declared_features to avoid two lookups.
1 parent 56fd253 commit 9d4e49b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

compiler/rustc_feature/src/active.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ macro_rules! declare_features {
116116
sym::$feature => status_to_enum!($status) == FeatureStatus::Incomplete,
117117
)*
118118
// accepted and removed features aren't in this file but are never incomplete
119-
_ if self.declared_lang_features.iter().any(|f| f.0 == feature) => false,
120-
_ if self.declared_lib_features.iter().any(|f| f.0 == feature) => false,
119+
_ if self.declared_features.contains(&feature) => false,
121120
_ => panic!("`{}` was not listed in `declare_features`", feature),
122121
}
123122
}
@@ -132,8 +131,7 @@ macro_rules! declare_features {
132131
)*
133132
// accepted and removed features aren't in this file but are never internal
134133
// (a removed feature might have been internal, but it doesn't matter anymore)
135-
_ if self.declared_lang_features.iter().any(|f| f.0 == feature) => false,
136-
_ if self.declared_lib_features.iter().any(|f| f.0 == feature) => false,
134+
_ if self.declared_features.contains(&feature) => false,
137135
_ => panic!("`{}` was not listed in `declare_features`", feature),
138136
}
139137
}

0 commit comments

Comments
 (0)