]>
Commit | Line | Data |
---|---|---|
8faf50e0 XL |
1 | #[cfg] //~ ERROR `cfg` is not followed by parentheses |
2 | struct S1; | |
3 | ||
4 | #[cfg = 10] //~ ERROR `cfg` is not followed by parentheses | |
5 | struct S2; | |
6 | ||
7 | #[cfg()] //~ ERROR `cfg` predicate is not specified | |
8 | struct S3; | |
9 | ||
10 | #[cfg(a, b)] //~ ERROR multiple `cfg` predicates are specified | |
11 | struct S4; | |
12 | ||
13 | #[cfg("str")] //~ ERROR `cfg` predicate key cannot be a literal | |
14 | struct S5; | |
15 | ||
16 | #[cfg(a::b)] //~ ERROR `cfg` predicate key must be an identifier | |
17 | struct S6; | |
18 | ||
19 | #[cfg(a())] //~ ERROR invalid predicate `a` | |
20 | struct S7; | |
21 | ||
22 | #[cfg(a = 10)] //~ ERROR literal in `cfg` predicate value must be a string | |
23 | struct S8; | |
24 | ||
a1dfa0c6 XL |
25 | #[cfg(a = b"hi")] //~ ERROR literal in `cfg` predicate value must be a string |
26 | struct S9; | |
27 | ||
28 | macro_rules! generate_s10 { | |
8faf50e0 XL |
29 | ($expr: expr) => { |
30 | #[cfg(feature = $expr)] //~ ERROR `cfg` is not a well-formed meta-item | |
a1dfa0c6 | 31 | struct S10; |
8faf50e0 XL |
32 | } |
33 | } | |
34 | ||
a1dfa0c6 | 35 | generate_s10!(concat!("nonexistent")); |