Fix evaluation order of the cfg_if! macro
Since #[cfg] attributes are short-circuting, cfg_if! should not change
the order in which the predicates are listed. This enables the use of
unstable cfg attributes in cfg_if!, which is useful when building libstd.
diff --git a/src/macros.rs b/src/macros.rs
index 3c2978e..5811c84 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -23,7 +23,7 @@
macro_rules! __cfg_if_items {
(($($not:meta,)*) ; ) => {};
(($($not:meta,)*) ; ( ($($m:meta),*) ($($it:item)*) ), $($rest:tt)*) => {
- __cfg_if_apply! { cfg(all($($m,)* not(any($($not),*)))), $($it)* }
+ __cfg_if_apply! { cfg(all(not(any($($not),*)), $($m,)*)), $($it)* }
__cfg_if_items! { ($($not,)* $($m,)*) ; $($rest)* }
}
}