diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-10-04 10:06:17 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-10-05 10:23:20 +1100 |
| commit | 043a9873b9ca6671744cf29c5cd0fe04c54e9032 (patch) | |
| tree | c117d47d04c260a0718e125ac5f6e90802f4fb89 | |
| parent | 53fe37de2e11537bf2953a29df3c5be8a8858850 (diff) | |
| download | rust-043a9873b9ca6671744cf29c5cd0fe04c54e9032.tar.gz rust-043a9873b9ca6671744cf29c5cd0fe04c54e9032.zip | |
Remove `set!` macro.
It has a single call site.
| -rw-r--r-- | compiler/rustc_feature/src/active.rs | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs index 5173dc7ccaa..c5a25347893 100644 --- a/compiler/rustc_feature/src/active.rs +++ b/compiler/rustc_feature/src/active.rs @@ -7,15 +7,6 @@ use rustc_span::edition::Edition; use rustc_span::symbol::{sym, Symbol}; use rustc_span::Span; -macro_rules! set { - ($field: ident) => {{ - fn f(features: &mut Features) { - features.$field = true; - } - f as fn(&mut Features) - }}; -} - #[derive(PartialEq)] enum FeatureStatus { Default, @@ -43,7 +34,15 @@ macro_rules! declare_features { &[$( // (sym::$feature, $ver, $issue, $edition, set!($feature)) Feature { - state: State::Active { set: set!($feature) }, + state: State::Active { + // Sets this feature's corresponding bool within `features`. + set: { + fn f(features: &mut Features) { + features.$feature = true; + } + f as fn(&mut Features) + } + }, name: sym::$feature, since: $ver, issue: to_nonzero($issue), |
