Files
rust/tests/ui/conditional-compilation/cfg-attr-syntax-validation.stderr

89 lines
2.4 KiB
Plaintext
Raw Normal View History

2025-07-07 09:10:38 +02:00
error[E0539]: malformed `cfg` attribute input
2018-09-02 00:13:22 +03:00
--> $DIR/cfg-attr-syntax-validation.rs:1:1
|
2019-03-09 15:03:44 +03:00
LL | #[cfg]
2025-07-07 09:10:38 +02:00
| ^^^^^^
| |
| expected this to be a list
| help: must be of the form: `#[cfg(predicate)]`
2018-09-02 00:13:22 +03:00
2025-07-07 09:10:38 +02:00
error[E0539]: malformed `cfg` attribute input
--> $DIR/cfg-attr-syntax-validation.rs:6:1
2018-09-02 00:13:22 +03:00
|
2019-03-09 15:03:44 +03:00
LL | #[cfg = 10]
2025-07-07 09:10:38 +02:00
| ^^^^^^^^^^^
| |
| expected this to be a list
| help: must be of the form: `#[cfg(predicate)]`
2018-09-02 00:13:22 +03:00
2025-07-07 09:10:38 +02:00
error[E0805]: malformed `cfg` attribute input
--> $DIR/cfg-attr-syntax-validation.rs:11:1
2018-09-02 00:13:22 +03:00
|
2019-03-09 15:03:44 +03:00
LL | #[cfg()]
2025-07-07 09:10:38 +02:00
| ^^^^^--^
| | |
| | expected a single argument here
| help: must be of the form: `#[cfg(predicate)]`
2018-09-02 00:13:22 +03:00
2025-07-07 09:10:38 +02:00
error[E0805]: malformed `cfg` attribute input
--> $DIR/cfg-attr-syntax-validation.rs:16:1
2018-09-02 00:13:22 +03:00
|
2019-03-09 15:03:44 +03:00
LL | #[cfg(a, b)]
2025-07-07 09:10:38 +02:00
| ^^^^^------^
| | |
| | expected a single argument here
| help: must be of the form: `#[cfg(predicate)]`
2018-09-02 00:13:22 +03:00
2025-07-07 09:10:38 +02:00
error: `cfg` predicate key must be an identifier
--> $DIR/cfg-attr-syntax-validation.rs:21:7
2018-09-02 00:13:22 +03:00
|
2019-03-09 15:03:44 +03:00
LL | #[cfg("str")]
2018-09-02 00:13:22 +03:00
| ^^^^^
error: `cfg` predicate key must be an identifier
2025-07-07 09:10:38 +02:00
--> $DIR/cfg-attr-syntax-validation.rs:24:7
2018-09-02 00:13:22 +03:00
|
2019-03-09 15:03:44 +03:00
LL | #[cfg(a::b)]
2018-09-02 00:13:22 +03:00
| ^^^^
error[E0537]: invalid predicate `a`
2025-07-07 09:10:38 +02:00
--> $DIR/cfg-attr-syntax-validation.rs:27:7
2018-09-02 00:13:22 +03:00
|
2019-03-09 15:03:44 +03:00
LL | #[cfg(a())]
2018-09-02 00:13:22 +03:00
| ^^^
2025-07-07 09:10:38 +02:00
error[E0539]: malformed `cfg` attribute input
--> $DIR/cfg-attr-syntax-validation.rs:30:1
2018-09-02 00:13:22 +03:00
|
2019-03-09 15:03:44 +03:00
LL | #[cfg(a = 10)]
2025-07-07 09:10:38 +02:00
| ^^^^^^^^^^--^^
| | |
| | expected a string literal here
| help: must be of the form: `#[cfg(predicate)]`
2018-09-02 00:13:22 +03:00
2025-07-07 09:10:38 +02:00
error[E0539]: malformed `cfg` attribute input
--> $DIR/cfg-attr-syntax-validation.rs:34:1
|
2019-03-09 15:03:44 +03:00
LL | #[cfg(a = b"hi")]
2025-07-07 09:10:38 +02:00
| ^^^^^^^^^^-^^^^^^
2022-08-27 02:23:21 +09:00
| |
| help: consider removing the prefix
2025-07-07 09:10:38 +02:00
|
= note: expected a normal string literal, not a byte string literal
error: expected unsuffixed literal, found `expr` metavariable
2025-07-07 09:10:38 +02:00
--> $DIR/cfg-attr-syntax-validation.rs:40:25
2018-09-02 00:13:22 +03:00
|
LL | #[cfg(feature = $expr)]
| ^^^^^
2018-09-02 00:13:22 +03:00
...
LL | generate_s10!(concat!("nonexistent"));
2021-10-14 13:28:28 -05:00
| ------------------------------------- in this macro invocation
|
= note: this error originates in the macro `generate_s10` (in Nightly builds, run with -Z macro-backtrace for more info)
2018-09-02 00:13:22 +03:00
error: aborting due to 10 previous errors
2018-09-02 00:13:22 +03:00
2025-07-07 09:10:38 +02:00
Some errors have detailed explanations: E0537, E0539, E0805.
2018-10-09 22:55:07 +08:00
For more information about an error, try `rustc --explain E0537`.