Skip to content

Commit d6072e5

Browse files
committed
Add UI test for cfg!(foo, bar)
1 parent 761c846 commit d6072e5

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/test/ui/macros/cfg.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ fn main() {
22
cfg!(); //~ ERROR macro requires a cfg-pattern
33
cfg!(123); //~ ERROR expected identifier
44
cfg!(foo = 123); //~ ERROR literal in `cfg` predicate value must be a string
5+
cfg!(foo, bar); //~ ERROR expected 1 cfg-pattern
56
}

src/test/ui/macros/cfg.stderr

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ error[E0565]: literal in `cfg` predicate value must be a string
1818
LL | cfg!(foo = 123);
1919
| ^^^
2020

21-
error: aborting due to 3 previous errors
21+
error: expected 1 cfg-pattern
22+
--> $DIR/cfg.rs:5:5
23+
|
24+
LL | cfg!(foo, bar);
25+
| ^^^^^^^^^^^^^^
26+
|
27+
= note: this error originates in the macro `cfg` (in Nightly builds, run with -Z macro-backtrace for more info)
28+
29+
error: aborting due to 4 previous errors
2230

2331
For more information about this error, try `rustc --explain E0565`.

0 commit comments

Comments
 (0)