]> git.lizzy.rs Git - rust.git/blob - src/test/ui/proc-macro/auxiliary/not-joint.rs
normalize stderr
[rust.git] / src / test / ui / proc-macro / auxiliary / not-joint.rs
1 // force-host
2 // no-prefer-dynamic
3
4 #![crate_type = "proc-macro"]
5
6 extern crate proc_macro;
7
8 use proc_macro::*;
9
10 #[proc_macro]
11 pub fn tokens(input: TokenStream) -> TokenStream {
12     assert_nothing_joint(input);
13     TokenStream::new()
14 }
15
16 #[proc_macro_attribute]
17 pub fn nothing(_: TokenStream, input: TokenStream) -> TokenStream {
18     assert_nothing_joint(input);
19     TokenStream::new()
20 }
21
22 fn assert_nothing_joint(s: TokenStream) {
23     for tt in s {
24         match tt {
25             TokenTree::Group(g) => assert_nothing_joint(g.stream()),
26             TokenTree::Punct(p) => assert_eq!(p.spacing(), Spacing::Alone),
27             _ => {}
28         }
29     }
30 }