mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-24 10:55:04 +00:00
19 lines
407 B
Rust
19 lines
407 B
Rust
|
//! 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()
|
||
|
}
|