Add UI test for cfg!(foo, bar)

This commit is contained in:
beetrees 2022-06-21 19:28:22 +01:00
parent 761c846a07
commit d6072e53cd
No known key found for this signature in database
GPG key ID: 8791BD754191EBD6
2 changed files with 10 additions and 1 deletions

View file

@ -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
}

View file

@ -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`.