]> git.lizzy.rs Git - rust.git/blob - tests/ui/proc-macro/illegal-proc-macro-derive-use.rs
add tests for 107090
[rust.git] / tests / ui / proc-macro / illegal-proc-macro-derive-use.rs
1 extern crate proc_macro;
2
3 #[proc_macro_derive(Foo)]
4 //~^ ERROR: only usable with crates of the `proc-macro` crate type
5 pub fn foo(a: proc_macro::TokenStream) -> proc_macro::TokenStream {
6     a
7 }
8
9 // Issue #37590
10 #[proc_macro_derive(Foo)]
11 //~^ ERROR: the `#[proc_macro_derive]` attribute may only be used on bare functions
12 pub struct Foo {
13 }
14
15 fn main() {}