summary refs log tree commit diff
path: root/src/test/ui/proc-macro/attribute-after-derive-feature-gate.rs
blob: f0fec6782423ef73901040aaef98f12622e3b4d2 (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
30
31
32
33
34
35
36
37
// gate-test-macro_attributes_in_derive_output
// aux-build: test-macros.rs

#![feature(proc_macro_hygiene)]
#![feature(stmt_expr_attributes)]

#[macro_use]
extern crate test_macros;

#[derive(Empty)]
#[empty_attr] //~ ERROR macro attributes in `#[derive]` output are unstable
struct S1 {
    field: [u8; 10],
}

#[derive(Empty)]
#[empty_helper]
#[empty_attr] //~ ERROR macro attributes in `#[derive]` output are unstable
struct S2 {
    field: [u8; 10],
}

#[derive(Empty)]
struct S3 {
    field: [u8; #[identity_attr] 10], //~ ERROR macro attributes in `#[derive]` output are unstable
}

#[derive(Empty)]
struct S4 {
    field: [u8; {
        #[derive(Empty)] // OK, not gated
        struct Inner;
        10
    }]
}

fn main() {}