about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbeetrees <b@beetr.ee>2022-06-21 19:28:22 +0100
committerbeetrees <b@beetr.ee>2022-06-21 19:28:22 +0100
commitd6072e53cd975839ad5e4c2d3ae101ce7ea0c3c0 (patch)
treef217088154fcef9ea530af24c7112bad9c2671e9
parent761c846a0751ea48c45b246b0b21407e72e906b1 (diff)
downloadrust-d6072e53cd975839ad5e4c2d3ae101ce7ea0c3c0.tar.gz
rust-d6072e53cd975839ad5e4c2d3ae101ce7ea0c3c0.zip
Add UI test for `cfg!(foo, bar)`
-rw-r--r--src/test/ui/macros/cfg.rs1
-rw-r--r--src/test/ui/macros/cfg.stderr10
2 files changed, 10 insertions, 1 deletions
diff --git a/src/test/ui/macros/cfg.rs b/src/test/ui/macros/cfg.rs
index 222161a8183..2aac50a9d01 100644
--- a/src/test/ui/macros/cfg.rs
+++ b/src/test/ui/macros/cfg.rs
@@ -2,4 +2,5 @@ fn main() {
     cfg!(); //~ ERROR macro requires a cfg-pattern
     cfg!(123); //~ ERROR expected identifier
     cfg!(foo = 123); //~ ERROR literal in `cfg` predicate value must be a string
+    cfg!(foo, bar); //~ ERROR expected 1 cfg-pattern
 }
diff --git a/src/test/ui/macros/cfg.stderr b/src/test/ui/macros/cfg.stderr
index 4785ef9aae4..2633d5f720d 100644
--- a/src/test/ui/macros/cfg.stderr
+++ b/src/test/ui/macros/cfg.stderr
@@ -18,6 +18,14 @@ error[E0565]: literal in `cfg` predicate value must be a string
 LL |     cfg!(foo = 123);
    |                ^^^
 
-error: aborting due to 3 previous errors
+error: expected 1 cfg-pattern
+  --> $DIR/cfg.rs:5:5
+   |
+LL |     cfg!(foo, bar);
+   |     ^^^^^^^^^^^^^^
+   |
+   = note: this error originates in the macro `cfg` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 4 previous errors
 
 For more information about this error, try `rustc --explain E0565`.