2018-11-24 15:34:13 +02:00
|
|
|
// force-host
|
2016-11-08 04:06:40 +00:00
|
|
|
// no-prefer-dynamic
|
|
|
|
|
2020-06-14 14:30:42 +03:00
|
|
|
#![feature(proc_macro_quote)]
|
|
|
|
|
2016-11-08 04:06:40 +00:00
|
|
|
#![crate_type = "proc-macro"]
|
|
|
|
|
|
|
|
extern crate proc_macro;
|
2020-06-14 14:30:42 +03:00
|
|
|
use proc_macro::*;
|
2016-11-08 04:06:40 +00:00
|
|
|
|
2018-06-11 19:29:12 -04:00
|
|
|
// Outputs another copy of the struct. Useful for testing the tokens
|
|
|
|
// seen by the proc_macro.
|
2016-11-08 04:06:40 +00:00
|
|
|
#[proc_macro_derive(Double)]
|
|
|
|
pub fn derive(input: TokenStream) -> TokenStream {
|
2020-06-14 14:30:42 +03:00
|
|
|
quote!(mod foo { $input })
|
2016-11-08 04:06:40 +00:00
|
|
|
}
|