]>
Commit | Line | Data |
---|---|---|
b7449926 | 1 | // run-pass |
1a4d82fc JJ |
2 | // compile-flags:--cfg set1 --cfg set2 |
3 | #![allow(dead_code)] | |
85aaf69f | 4 | use std::fmt::Debug; |
1a4d82fc | 5 | |
85aaf69f | 6 | struct NotDebugable; |
1a4d82fc | 7 | |
85aaf69f | 8 | #[cfg_attr(set1, derive(Debug))] |
1a4d82fc JJ |
9 | struct Set1; |
10 | ||
85aaf69f SL |
11 | #[cfg_attr(notset, derive(Debug))] |
12 | struct Notset(NotDebugable); | |
1a4d82fc | 13 | |
85aaf69f | 14 | #[cfg_attr(not(notset), derive(Debug))] |
1a4d82fc JJ |
15 | struct NotNotset; |
16 | ||
85aaf69f SL |
17 | #[cfg_attr(not(set1), derive(Debug))] |
18 | struct NotSet1(NotDebugable); | |
1a4d82fc | 19 | |
85aaf69f | 20 | #[cfg_attr(all(set1, set2), derive(Debug))] |
1a4d82fc JJ |
21 | struct AllSet1Set2; |
22 | ||
85aaf69f SL |
23 | #[cfg_attr(all(set1, notset), derive(Debug))] |
24 | struct AllSet1Notset(NotDebugable); | |
1a4d82fc | 25 | |
85aaf69f | 26 | #[cfg_attr(any(set1, notset), derive(Debug))] |
1a4d82fc JJ |
27 | struct AnySet1Notset; |
28 | ||
85aaf69f SL |
29 | #[cfg_attr(any(notset, notset2), derive(Debug))] |
30 | struct AnyNotsetNotset2(NotDebugable); | |
1a4d82fc | 31 | |
85aaf69f | 32 | #[cfg_attr(all(not(notset), any(set1, notset)), derive(Debug))] |
1a4d82fc JJ |
33 | struct Complex; |
34 | ||
85aaf69f SL |
35 | #[cfg_attr(any(notset, not(any(set1, notset))), derive(Debug))] |
36 | struct ComplexNot(NotDebugable); | |
1a4d82fc | 37 | |
85aaf69f | 38 | #[cfg_attr(any(target_endian = "little", target_endian = "big"), derive(Debug))] |
1a4d82fc JJ |
39 | struct KeyValue; |
40 | ||
85aaf69f | 41 | fn is_show<T: Debug>() {} |
1a4d82fc JJ |
42 | |
43 | fn main() { | |
44 | is_show::<Set1>(); | |
45 | is_show::<NotNotset>(); | |
46 | is_show::<AllSet1Set2>(); | |
47 | is_show::<AnySet1Notset>(); | |
48 | is_show::<Complex>(); | |
49 | is_show::<KeyValue>(); | |
50 | } |