about summary refs log tree commit diff
path: root/tests/ui/feature-gates/issue-43106-gating-of-proc_macro_derive.rs
blob: 35392b4eff697af6a43b648c70b15e7b6cae7ae5 (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
27
28
29
// This file sits on its own because the occurrences here
// signal errors, making it incompatible with the "warnings only"
// nature of issue-43106-gating-of-builtin-attrs.rs

#[proc_macro_derive(Test)]
//~^ ERROR attribute cannot be used on
mod proc_macro_derive1 {
    mod inner { #![proc_macro_derive(Test)] }
    //~^ ERROR attribute cannot be used on
}

mod proc_macro_derive2 {
    mod inner { #![proc_macro_derive(Test)] }
    //~^ ERROR attribute cannot be used on

    #[proc_macro_derive(Test)] fn f() { }
    //~^ ERROR the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro`

    #[proc_macro_derive(Test)] struct S;
    //~^ ERROR attribute cannot be used on

    #[proc_macro_derive(Test)] type T = S;
    //~^ ERROR attribute cannot be used on

    #[proc_macro_derive(Test)] impl S { }
    //~^ ERROR attribute cannot be used on
}

fn main() {}