]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/auxiliary/through-proc-macro-aux.rs
Rollup merge of #71829 - kper:issue71136, r=matthewjasper
[rust.git] / src / test / rustdoc / auxiliary / through-proc-macro-aux.rs
1 // force-host
2 // no-prefer-dynamic
3 #![crate_type = "proc-macro"]
4 #![crate_name="some_macros"]
5
6 extern crate proc_macro;
7 use proc_macro::TokenStream;
8
9 #[proc_macro_attribute]
10 pub fn first(_attr: TokenStream, item: TokenStream) -> TokenStream {
11     item // This doesn't erase the spans.
12 }
13
14 #[proc_macro_attribute]
15 pub fn second(_attr: TokenStream, item: TokenStream) -> TokenStream {
16     // Make a new `TokenStream` to erase the spans:
17     let mut out: TokenStream = TokenStream::new();
18     out.extend(item);
19     out
20 }