mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-06 04:08:40 +00:00
12 lines
286 B
Rust
12 lines
286 B
Rust
#![feature(proc_macro_quote)]
|
|
|
|
extern crate proc_macro;
|
|
use proc_macro::*;
|
|
|
|
// Outputs another copy of the struct. Useful for testing the tokens
|
|
// seen by the proc_macro.
|
|
#[proc_macro_derive(Double)]
|
|
pub fn derive(input: TokenStream) -> TokenStream {
|
|
quote!(mod foo { $input })
|
|
}
|