Skip to content

Commit

Permalink
remove the __apply internal macro
Browse files Browse the repository at this point in the history
  • Loading branch information
Lokathor committed Sep 24, 2019
1 parent 75e817f commit 571a28d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,14 @@ 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
// will have to negate everything we just matched as well.
$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)*) => {
Expand Down

0 comments on commit 571a28d

Please sign in to comment.