2018-11-24 07:34:13 -06:00
|
|
|
// force-host
|
2018-05-17 11:30:43 -05:00
|
|
|
// no-prefer-dynamic
|
|
|
|
|
|
|
|
#![crate_type = "proc-macro"]
|
|
|
|
|
|
|
|
extern crate proc_macro;
|
|
|
|
|
|
|
|
use proc_macro::*;
|
|
|
|
|
|
|
|
#[proc_macro]
|
|
|
|
pub fn tokens(input: TokenStream) -> TokenStream {
|
|
|
|
assert_nothing_joint(input);
|
2018-05-25 21:44:07 -05:00
|
|
|
TokenStream::new()
|
2018-05-17 11:30:43 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#[proc_macro_attribute]
|
|
|
|
pub fn nothing(_: TokenStream, input: TokenStream) -> TokenStream {
|
|
|
|
assert_nothing_joint(input);
|
2018-05-25 21:44:07 -05:00
|
|
|
TokenStream::new()
|
2018-05-17 11:30:43 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn assert_nothing_joint(s: TokenStream) {
|
|
|
|
for tt in s {
|
|
|
|
match tt {
|
|
|
|
TokenTree::Group(g) => assert_nothing_joint(g.stream()),
|
|
|
|
TokenTree::Punct(p) => assert_eq!(p.spacing(), Spacing::Alone),
|
|
|
|
_ => {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|