summaryrefslogtreecommitdiffstats
path: root/tests/ui/proc-macro/auxiliary/issue-42708.rs
blob: dae05204b8b70996f3fb7e2443586c0e14b7f0c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// force-host
// no-prefer-dynamic

#![crate_type = "proc-macro"]

extern crate proc_macro;

use proc_macro::TokenStream;

#[proc_macro_derive(Test)]
pub fn derive(_input: TokenStream) -> TokenStream {
    "fn f(s: S) { s.x }".parse().unwrap()
}

#[proc_macro_attribute]
pub fn attr_test(_attr: TokenStream, input: TokenStream) -> TokenStream {
    input
}