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