]> git.proxmox.com Git - rustc.git/blame - src/test/ui/proc-macro/macro-rules-derive-cfg.rs
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / src / test / ui / proc-macro / macro-rules-derive-cfg.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#![feature(stmt_expr_attributes)]
7
8#![no_std] // Don't load unnecessary hygiene information from std
9extern crate std;
10
11#[macro_use]
12extern crate test_macros;
13
14macro_rules! produce_it {
15 ($expr:expr) => {
16 #[derive(Print)]
17 struct Foo {
18 val: [bool; {
19 let a = #[cfg_attr(not(FALSE), rustc_dummy(first))] $expr;
20 0
21 }]
22 }
23 }
24}
25
26produce_it!(#[cfg_attr(not(FALSE), rustc_dummy(second))] {
27 #![cfg_attr(not(FALSE), allow(unused))]
28 30
29});
30
31fn main() {}