]>
Commit | Line | Data |
---|---|---|
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 | |
8 | extern crate std; | |
9 | ||
10 | #[macro_use] | |
11 | extern crate test_macros; | |
12 | ||
13 | macro_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 | ||
26 | expand_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 | ||
34 | fn main() {} |