diff --git a/src/lib.rs b/src/lib.rs index 6bf5970..280af61 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -82,7 +82,7 @@ macro_rules! cfg_if { $( $yes , )? not(any( $( $no ),* )) ))] - $( $tokens )* + $crate::cfg_if! { @__identity $( $tokens )* } // Recurse to emit all other items in `$rest`, and when we do so add all // our `$yes` matchers to the list of `$no` matchers as future emissions @@ -92,6 +92,12 @@ macro_rules! cfg_if { $( $rest , )* } }; + + // Internal macro to make __apply work out right for different match types, + // because of how macros match/expand stuff. + (@__identity $( $tokens:tt )* ) => { + $( $tokens )* + }; } #[cfg(test)]