rustfoundry/utils.rs
1// NOTE: don't complain about unused macro for feature combinations that don't use it.
2#[allow(unused_macros)]
3macro_rules! feature_use {
4 ( $cfg:meta, { $( $tokens:tt )+ } ) => {
5 // NOTE: a trick to apply attribute to all the tokens in a group without
6 // introducing a new block or scope: we apply the attribute
7 // to a macro call that expand to those tokens instead.
8 #[$cfg]
9 $crate::utils::feature_use!(@tokens $($tokens)*);
10 };
11
12 ( @tokens $( $tokens:tt )* ) => { $( $tokens )* };
13}
14
15// NOTE: don't complain about unused macro for feature combinations that don't use it.
16#[allow(unused_imports)]
17pub(crate) use feature_use;