]>
Commit | Line | Data |
---|---|---|
7453a54e | 1 | // Copyright 2016 The Rust Project Developers. See the COPYRIGHT |
223e47cc LB |
2 | // file at the top-level directory of this distribution and at |
3 | // http://rust-lang.org/COPYRIGHT. | |
4 | // | |
5 | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | |
6 | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | |
7 | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | |
8 | // option. This file may not be copied, modified, or distributed | |
9 | // except according to those terms. | |
10 | ||
9e0c209e | 11 | // no-prefer-dynamic |
1a4d82fc | 12 | |
9e0c209e SL |
13 | #![crate_type = "rustc-macro"] |
14 | #![feature(rustc_macro)] | |
15 | #![feature(rustc_macro_lib)] | |
223e47cc | 16 | |
9e0c209e | 17 | extern crate rustc_macro; |
223e47cc | 18 | |
9e0c209e | 19 | use rustc_macro::TokenStream; |
a7813a04 | 20 | |
9e0c209e SL |
21 | #[rustc_macro_derive(CToD)] |
22 | pub fn derive(input: TokenStream) -> TokenStream { | |
23 | let input = input.to_string(); | |
24 | assert_eq!(input, "struct C;\n"); | |
25 | "struct D;".parse().unwrap() | |
223e47cc | 26 | } |