Skip to content

Commit 499cf52

Browse files
committed
Change to a slightly more forgiving update path
1 parent 3cf812a commit 499cf52

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

active/0000-cfg-syntax.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,14 @@ fn foo() {}
5656
```
5757
will change from "include `foo` if *either of* `a` and `b` are present in the
5858
compilation environment" to "include `foo` if *both of* `a` and `b` are present
59-
in the compilation environment". To ease the transition it will be an error to
60-
have multiple `#[cfg(...)]` attributes on a single item for some reasonable
61-
period of time.
59+
in the compilation environment". To ease the transition, the old semantics of
60+
multiple `#[cfg(...)]` attributes will be maintained as a special case, with a
61+
warning. After some reasonable period of time, the special case will be
62+
removed.
63+
64+
In addition, `#[cfg(a, b, c)]` will be accepted with a warning and be
65+
equivalent to `#[cfg(all(a, b, c))]`. Again, after some reasonable period of
66+
time, this behavior will be removed as well.
6267

6368
The `cfg!()` syntax extension will be modified to accept cfg patterns as well.
6469
A `#[cfg_attr(<p>, <attr>)]` syntax extension will be added
@@ -89,3 +94,9 @@ little readability gain.
8994

9095
How long should multiple `#[cfg(...)]` attributes on a single item be
9196
forbidden? It should probably be at least until after 0.12 releases.
97+
98+
Should we permanently keep the behavior of treating `#[cfg(a, b)]` as
99+
`#[cfg(all(a, b))]`? It is the common case, and adding this interpretation
100+
can reduce the noise level a bit. On the other hand, it may be a bit confusing
101+
to read as it's not immediately clear if it will be processed as `and(..)` or
102+
`all(..)`.

0 commit comments

Comments
 (0)