Skip to content

Commit

Permalink
Use declared_features to avoid two lookups.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed Oct 5, 2023
1 parent 56fd253 commit 9d4e49b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions compiler/rustc_feature/src/active.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
}
Expand All @@ -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),
}
}
Expand Down

0 comments on commit 9d4e49b

Please sign in to comment.