summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc/intra-doc/auxiliary/proc-macro-macro.rs
blob: 5ba132f25b4710b6c4e0345b52193e3f8f93601e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// force-host
// no-prefer-dynamic
// compile-flags: --crate-type proc-macro

#![crate_type="proc-macro"]

extern crate proc_macro;

use proc_macro::TokenStream;

#[proc_macro_derive(DeriveA)]
pub fn a_derive(input: TokenStream) -> TokenStream {
    input
}

#[proc_macro_derive(DeriveB)]
pub fn b_derive(input: TokenStream) -> TokenStream {
    input
}

#[proc_macro_derive(DeriveTrait)]
pub fn trait_derive(input: TokenStream) -> TokenStream {
    input
}

#[proc_macro_attribute]
pub fn attr_a(input: TokenStream, _args: TokenStream) -> TokenStream {
    input
}

#[proc_macro_attribute]
pub fn attr_b(input: TokenStream, _args: TokenStream) -> TokenStream {
    input
}