]> git.proxmox.com Git - rustc.git/blame - src/test/ui/proc-macro/expand-to-derive.rs
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / src / test / ui / proc-macro / expand-to-derive.rs
CommitLineData
6a06907d
XL
1// check-pass
2// compile-flags: -Z span-debug --error-format human
3// aux-build:test-macros.rs
4
5#![feature(rustc_attrs)]
6
7#![no_std] // Don't load unnecessary hygiene information from std
8extern crate std;
9
10#[macro_use]
11extern crate test_macros;
12
13macro_rules! expand_to_derive {
14 ($item:item) => {
15 #[derive(Print)]
16 struct Foo {
17 #[cfg(FALSE)] removed: bool,
18 field: [bool; {
19 $item
20 0
21 }]
22 }
23 };
24}
25
26expand_to_derive! {
27 #[cfg_attr(not(FALSE), rustc_dummy)]
28 struct Inner {
29 #[cfg(FALSE)] removed_inner_field: bool,
30 other_inner_field: u8,
31 }
32}
33
34fn main() {}