summaryrefslogtreecommitdiffstats
path: root/src/test/ui/proc-macro/issue-75930-derive-cfg.rs
blob: e0f248c67e8b39b7529fa1cd5ef35c8f781ff9c2 (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
// check-pass
// compile-flags: -Z span-debug
// aux-build:test-macros.rs

// Regression test for issue #75930
// Tests that we cfg-strip all targets before invoking
// a derive macro

#[macro_use]
extern crate test_macros;

#[derive(Print)]
struct Foo<#[cfg(FALSE)] A, B> {
    #[cfg(FALSE)] first: String,
    second: bool,
    third: [u8; {
        #[cfg(FALSE)] struct Bar;
        #[cfg(not(FALSE))] struct Inner;
        #[cfg(FALSE)] let a = 25;
        match true {
            #[cfg(FALSE)] true => {},
            false => {},
            _ => {}
        };
        0
    }],
    fourth: B
}

fn main() {}