Skip to content

Commit b97b58f

Browse files
committed
rfc: cfg_attr-multiple-attrs - Disallow cfg_attr(predicate)
1 parent 4314792 commit b97b58f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

text/0000-cfg_attr-multiple-attrs.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,18 @@ configuration predicate.
6161
It is written as `cfg_attr` followed by `(`, a comma separated metaitem
6262
sequence, and then `)` The metaitem sequence contains one or more metaitems.
6363
The first is a conditional predicate. The rest are metaitems that are also
64-
attributes. Trailing commas are permitted. The following list are all allowed:
64+
attributes. Trailing commas after attributes are permitted. The following list
65+
are all allowed:
6566

6667
* `cfg_attr(predicate, attr)`
6768
* `cfg_attr(predicate, attr_1, attr_2)`
6869
* `cfg_attr(predicate, attr,)`
6970
* `cfg_attr(predicate, attr_1, attr_2,)`
70-
* `cfg_attr(predicate)`
7171
* `cfg_attr(predicate,)`
7272

73+
> Note: `cfg_attr(predicate)` is not allowed. That comma is semantically
74+
> distinct from the commas following attributes, so we require it.
75+
7376
When the configuration predicate is true, this attribute expands out to be an
7477
attribute for each attribute metaitem. For example, the following module will
7578
either be found at `linux.rs` or `windows.rs` based on the target.

0 commit comments

Comments
 (0)