2018-11-24 07:34:13 -06:00
|
|
|
// force-host
|
2017-09-12 14:55:41 -05:00
|
|
|
// no-prefer-dynamic
|
2018-07-03 17:36:31 -05:00
|
|
|
|
2017-09-12 14:55:41 -05:00
|
|
|
#![crate_type = "proc-macro"]
|
|
|
|
|
|
|
|
extern crate proc_macro;
|
|
|
|
|
|
|
|
use proc_macro::TokenStream;
|
|
|
|
|
|
|
|
#[proc_macro_attribute]
|
|
|
|
pub fn attr_cfg(args: TokenStream, input: TokenStream) -> TokenStream {
|
|
|
|
let input_str = input.to_string();
|
|
|
|
|
2020-06-14 06:30:42 -05:00
|
|
|
assert_eq!(input_str, "fn outer() -> u8
|
|
|
|
{
|
|
|
|
#[cfg(foo)] fn inner() -> u8 { 1 } #[cfg(bar)] fn inner() -> u8 { 2 }
|
2017-09-12 14:55:41 -05:00
|
|
|
inner()
|
|
|
|
}");
|
|
|
|
|
|
|
|
input
|
|
|
|
}
|