remove the __apply internal macro

This commit is contained in:
Lokathor 2019-09-24 08:57:25 -06:00
parent 75e817fa2c
commit 571a28d359

View File

@ -71,7 +71,7 @@ macro_rules! cfg_if {
// Emit all items within one block, applying an appropriate #[cfg]. The
// #[cfg] will require all `$m` matchers specified and must also negate
// all previous matchers.
$crate::cfg_if! { @__apply cfg(all($($m,)* not(any($($not),*)))), $($tokens)* }
#[cfg(all($($m,)* not(any($($not),*))))] $crate::cfg_if! { @__identity $($tokens)* }
// Recurse to emit all other items in `$rest`, and when we do so add all
// our `$m` matchers to the list of `$not` matchers as future emissions
@ -79,11 +79,6 @@ macro_rules! cfg_if {
$crate::cfg_if! { @__items ($($not,)* $($m,)*) ; $($rest)* }
};
// Internal macro to Apply a cfg attribute to a list of items
(@__apply $m:meta, $($tokens:tt)*) => {
#[$m] $crate::cfg_if! { @__identity $($tokens)* }
};
// Internal macro to make __apply work out right for different match types,
// because of how macros matching/expand stuff.
(@__identity $($tokens:tt)*) => {