rust/tests/rustdoc/intra-doc/auxiliary/proc-macro-macro.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
674 B
Rust
Raw Normal View History

// 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
}