aboutsummaryrefslogtreecommitdiff
path: root/crates/proc_macro_test/src/lib.rs
blob: ec2a114a35d987f5dc23115a2892ff596a761365 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Exports a few trivial procedural macros for testing.

use proc_macro::TokenStream;

#[proc_macro]
pub fn function_like_macro(args: TokenStream) -> TokenStream {
    args
}

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

#[proc_macro_derive(DummyTrait)]
pub fn derive_macro(_item: TokenStream) -> TokenStream {
    TokenStream::new()
}