rust/tests/ui/proc-macro/auxiliary/double.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
353 B
Rust
Raw Normal View History

// force-host
2016-11-07 22:06:40 -06:00
// no-prefer-dynamic
#![feature(proc_macro_quote)]
2016-11-07 22:06:40 -06:00
#![crate_type = "proc-macro"]
extern crate proc_macro;
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 {
quote!(mod foo { $input })
2016-11-07 22:06:40 -06:00
}