summaryrefslogtreecommitdiffstats
path: root/src/test/ui/proc-macro/auxiliary/issue-91800-macro.rs
blob: 958a8bed9e2d19e4bc2c4786bece56bb7b2641d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// force-host
// no-prefer-dynamic

#![crate_type = "proc-macro"]

extern crate proc_macro;

use proc_macro::TokenStream;

fn compile_error() -> TokenStream {
    r#"compile_error!("")"#.parse().unwrap()
}

#[proc_macro_derive(MyTrait)]
pub fn derive(input: TokenStream) -> TokenStream {
    compile_error()
}
#[proc_macro_attribute]
pub fn attribute_macro(_attr: TokenStream, mut input: TokenStream) -> TokenStream {
    input.extend(compile_error());
    input
}
#[proc_macro]
pub fn fn_macro(_item: TokenStream) -> TokenStream {
    compile_error()
}