Skip to content

Commit 8863db8

Browse files
committed
add broken test for multiple cfg arguments
1 parent 7e46c5f commit 8863db8

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

tests/ui/cfg/suggest-any-or-all.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#[cfg(foo, bar)]
2+
//~^ ERROR malformed `cfg` attribute input
3+
fn f() {}
4+
5+
#[cfg()]
6+
//~^ ERROR malformed `cfg` attribute input
7+
struct Foo;
8+
9+
fn main() {}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
error[E0805]: malformed `cfg` attribute input
2+
--> $DIR/suggest-any-or-all.rs:1:1
3+
|
4+
LL | #[cfg(foo, bar)]
5+
| ^^^^^----------^
6+
| | |
7+
| | expected a single argument here
8+
| help: must be of the form: `#[cfg(predicate)]`
9+
|
10+
= note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>
11+
12+
error[E0805]: malformed `cfg` attribute input
13+
--> $DIR/suggest-any-or-all.rs:5:1
14+
|
15+
LL | #[cfg()]
16+
| ^^^^^--^
17+
| | |
18+
| | expected a single argument here
19+
| help: must be of the form: `#[cfg(predicate)]`
20+
|
21+
= note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>
22+
23+
error: aborting due to 2 previous errors
24+
25+
For more information about this error, try `rustc --explain E0805`.

0 commit comments

Comments
 (0)