]>
git.proxmox.com Git - rustc.git/blob - src/test/rustdoc/inline_cross/auxiliary/proc_macro.rs
3 // compile-flags: --crate-type proc-macro
5 #![crate_type="proc-macro"]
6 #![crate_name="some_macros"]
8 extern crate proc_macro
;
10 use proc_macro
::TokenStream
;
12 macro_rules
! make_attr_macro
{
14 /// Generated doc comment
15 #[proc_macro_attribute]
16 pub fn $
name(args
: TokenStream
, input
: TokenStream
) -> TokenStream
{
22 make_attr_macro
!(first_attr
);
23 make_attr_macro
!(second_attr
);
25 /// a proc-macro that swallows its input and does nothing.
27 pub fn some_proc_macro(_input
: TokenStream
) -> TokenStream
{
31 /// a proc-macro attribute that passes its item through verbatim.
32 #[proc_macro_attribute]
33 pub fn some_proc_attr(_attr
: TokenStream
, item
: TokenStream
) -> TokenStream
{
37 /// a derive attribute that adds nothing to its input.
38 #[proc_macro_derive(SomeDerive)]
39 pub fn some_derive(_item
: TokenStream
) -> TokenStream
{
43 /// Doc comment from the original crate
45 pub fn reexported_macro(_input
: TokenStream
) -> TokenStream
{