2018-11-24 13:34:13 +00:00
|
|
|
// force-host
|
2016-11-08 04:06:40 +00:00
|
|
|
// no-prefer-dynamic
|
|
|
|
|
2020-06-14 11:30:42 +00:00
|
|
|
#![feature(proc_macro_quote)]
|
|
|
|
|
2016-11-08 04:06:40 +00:00
|
|
|
#![crate_type = "proc-macro"]
|
|
|
|
|
|
|
|
extern crate proc_macro;
|
2020-06-14 11:30:42 +00:00
|
|
|
use proc_macro::*;
|
2016-11-08 04:06:40 +00:00
|
|
|
|
2018-06-11 23:29:12 +00: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 11:30:42 +00:00
|
|
|
quote!(mod foo { $input })
|
2016-11-08 04:06:40 +00:00
|
|
|
}
|