From 043a9873b9ca6671744cf29c5cd0fe04c54e9032 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 4 Oct 2023 10:06:17 +1100 Subject: [PATCH] Remove `set!` macro. It has a single call site. --- compiler/rustc_feature/src/active.rs | 19 +++++++++---------- 1 file 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),