From a4b7ed7a42c716ab9f05e351f003d589124fd55d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:58 +0200 Subject: Adding upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../cfg-attr-syntax-validation.stderr | 82 ++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 tests/ui/conditional-compilation/cfg-attr-syntax-validation.stderr (limited to 'tests/ui/conditional-compilation/cfg-attr-syntax-validation.stderr') diff --git a/tests/ui/conditional-compilation/cfg-attr-syntax-validation.stderr b/tests/ui/conditional-compilation/cfg-attr-syntax-validation.stderr new file mode 100644 index 000000000..d5b4349c0 --- /dev/null +++ b/tests/ui/conditional-compilation/cfg-attr-syntax-validation.stderr @@ -0,0 +1,82 @@ +error: `cfg` is not followed by parentheses + --> $DIR/cfg-attr-syntax-validation.rs:1:1 + | +LL | #[cfg] + | ^^^^^^ help: expected syntax is: `cfg(/* predicate */)` + +error: `cfg` is not followed by parentheses + --> $DIR/cfg-attr-syntax-validation.rs:4:1 + | +LL | #[cfg = 10] + | ^^^^^^^^^^^ help: expected syntax is: `cfg(/* predicate */)` + +error: `cfg` predicate is not specified + --> $DIR/cfg-attr-syntax-validation.rs:7:1 + | +LL | #[cfg()] + | ^^^^^^^^ help: expected syntax is: `cfg(/* predicate */)` + +error: multiple `cfg` predicates are specified + --> $DIR/cfg-attr-syntax-validation.rs:10:10 + | +LL | #[cfg(a, b)] + | ^ + +error: `cfg` predicate key cannot be a literal + --> $DIR/cfg-attr-syntax-validation.rs:13:7 + | +LL | #[cfg("str")] + | ^^^^^ + +error: `cfg` predicate key must be an identifier + --> $DIR/cfg-attr-syntax-validation.rs:16:7 + | +LL | #[cfg(a::b)] + | ^^^^ + +error[E0537]: invalid predicate `a` + --> $DIR/cfg-attr-syntax-validation.rs:19:7 + | +LL | #[cfg(a())] + | ^^^ + +error[E0565]: literal in `cfg` predicate value must be a string + --> $DIR/cfg-attr-syntax-validation.rs:22:11 + | +LL | #[cfg(a = 10)] + | ^^ + +error[E0565]: literal in `cfg` predicate value must be a string + --> $DIR/cfg-attr-syntax-validation.rs:25:11 + | +LL | #[cfg(a = b"hi")] + | -^^^^ + | | + | help: consider removing the prefix + +error: expected unsuffixed literal or identifier, found `concat!("nonexistent")` + --> $DIR/cfg-attr-syntax-validation.rs:30: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: expected unsuffixed literal or identifier, found `concat!("nonexistent")` + --> $DIR/cfg-attr-syntax-validation.rs:30: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 11 previous errors + +Some errors have detailed explanations: E0537, E0565. +For more information about an error, try `rustc --explain E0537`. -- cgit v1.2.3