about summary refs log tree commit diff
path: root/tests/ui/conditional-compilation/cfg-attr-syntax-validation.stderr
blob: 59ff611e0661e9dadd5ae421f8c571f574b3963d (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
error[E0539]: malformed `cfg` attribute input
  --> $DIR/cfg-attr-syntax-validation.rs:1:1
   |
LL | #[cfg]
   | ^^^^^^
   | |
   | expected this to be a list
   | help: must be of the form: `#[cfg(predicate)]`
   |
   = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>

error[E0539]: malformed `cfg` attribute input
  --> $DIR/cfg-attr-syntax-validation.rs:7:1
   |
LL | #[cfg = 10]
   | ^^^^^^^^^^^
   | |
   | expected this to be a list
   | help: must be of the form: `#[cfg(predicate)]`
   |
   = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>

error[E0805]: malformed `cfg` attribute input
  --> $DIR/cfg-attr-syntax-validation.rs:13:1
   |
LL | #[cfg()]
   | ^^^^^--^
   | |    |
   | |    expected a single argument here
   | help: must be of the form: `#[cfg(predicate)]`
   |
   = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>

error[E0805]: malformed `cfg` attribute input
  --> $DIR/cfg-attr-syntax-validation.rs:19:1
   |
LL | #[cfg(a, b)]
   | ^^^^^------^
   | |    |
   | |    expected a single argument here
   | help: must be of the form: `#[cfg(predicate)]`
   |
   = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>

error: `cfg` predicate key must be an identifier
  --> $DIR/cfg-attr-syntax-validation.rs:25:7
   |
LL | #[cfg("str")]
   |       ^^^^^

error: `cfg` predicate key must be an identifier
  --> $DIR/cfg-attr-syntax-validation.rs:28:7
   |
LL | #[cfg(a::b)]
   |       ^^^^

error[E0537]: invalid predicate `a`
  --> $DIR/cfg-attr-syntax-validation.rs:31:7
   |
LL | #[cfg(a())]
   |       ^^^

error[E0539]: malformed `cfg` attribute input
  --> $DIR/cfg-attr-syntax-validation.rs:34:1
   |
LL | #[cfg(a = 10)]
   | ^^^^^^^^^^--^^
   | |         |
   | |         expected a string literal here
   | help: must be of the form: `#[cfg(predicate)]`
   |
   = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>

error[E0539]: malformed `cfg` attribute input
  --> $DIR/cfg-attr-syntax-validation.rs:39:1
   |
LL | #[cfg(a = b"hi")]
   | ^^^^^^^^^^-^^^^^^
   |           |
   |           help: consider removing the prefix
   |
   = note: expected a normal string literal, not a byte string literal

error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found `expr` metavariable
  --> $DIR/cfg-attr-syntax-validation.rs:45:25
   |
LL |         #[cfg(feature = $expr)]
   |                         ^^^^^
...
LL | generate_s10!(concat!("nonexistent"));
   | ------------------------------------- in this macro invocation
   |
   = note: this error originates in the macro `generate_s10` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 10 previous errors

Some errors have detailed explanations: E0537, E0539, E0805.
For more information about an error, try `rustc --explain E0537`.