]> git.lizzy.rs Git - rust.git/blob - src/test/ui/proc-macro/auxiliary/expand-with-a-macro.rs
normalize stderr
[rust.git] / src / test / ui / proc-macro / auxiliary / expand-with-a-macro.rs
1 // force-host
2 // no-prefer-dynamic
3
4 #![crate_type = "proc-macro"]
5 #![deny(warnings)]
6
7 extern crate proc_macro;
8
9 use proc_macro::TokenStream;
10
11 #[proc_macro_derive(A)]
12 pub fn derive(input: TokenStream) -> TokenStream {
13     let input = input.to_string();
14     assert!(input.contains("struct A ;"));
15     r#"
16         impl A {
17             fn a(&self) {
18                 panic!("hello");
19             }
20         }
21     "#.parse().unwrap()
22 }