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.
This commit is contained in:
parent
b7c3e5c026
commit
5d514b6c6a
|
@ -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)* }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue