]> git.proxmox.com Git - rustc.git/blame - src/test/run-pass-fulldeps/rustc-macro/auxiliary/derive-ctod.rs
New upstream version 1.13.0+dfsg1
[rustc.git] / src / test / run-pass-fulldeps / rustc-macro / auxiliary / derive-ctod.rs
CommitLineData
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 17extern crate rustc_macro;
223e47cc 18
9e0c209e 19use rustc_macro::TokenStream;
a7813a04 20
9e0c209e
SL
21#[rustc_macro_derive(CToD)]
22pub 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}