Skip to content
Snippets Groups Projects
Commit 5d514b6c authored by Sebastian Wicki's avatar Sebastian Wicki
Browse files

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.
parent b7c3e5c0
Loading
......@@ -23,7 +23,7 @@ macro_rules! cfg_if {
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)* }
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment