]> git.proxmox.com Git - rustc.git/blame - src/test/ui/conditional-compilation/cfg-attr-syntax-validation.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / conditional-compilation / cfg-attr-syntax-validation.rs
CommitLineData
8faf50e0
XL
1#[cfg] //~ ERROR `cfg` is not followed by parentheses
2struct S1;
3
4#[cfg = 10] //~ ERROR `cfg` is not followed by parentheses
5struct S2;
6
7#[cfg()] //~ ERROR `cfg` predicate is not specified
8struct S3;
9
10#[cfg(a, b)] //~ ERROR multiple `cfg` predicates are specified
11struct S4;
12
13#[cfg("str")] //~ ERROR `cfg` predicate key cannot be a literal
14struct S5;
15
16#[cfg(a::b)] //~ ERROR `cfg` predicate key must be an identifier
17struct S6;
18
19#[cfg(a())] //~ ERROR invalid predicate `a`
20struct S7;
21
22#[cfg(a = 10)] //~ ERROR literal in `cfg` predicate value must be a string
23struct S8;
24
a1dfa0c6
XL
25#[cfg(a = b"hi")] //~ ERROR literal in `cfg` predicate value must be a string
26struct S9;
27
28macro_rules! generate_s10 {
8faf50e0 29 ($expr: expr) => {
9fa01778 30 #[cfg(feature = $expr)]
532ac7d7 31 //~^ ERROR expected unsuffixed literal or identifier, found `concat!("nonexistent")`
29967ef6 32 //~| ERROR expected unsuffixed literal or identifier, found `concat!("nonexistent")`
a1dfa0c6 33 struct S10;
8faf50e0
XL
34 }
35}
36
a1dfa0c6 37generate_s10!(concat!("nonexistent"));
0731742a
XL
38
39fn main() {}