@@ -56,9 +56,14 @@ fn foo() {}
56
56
```
57
57
will change from "include ` foo ` if * either of* ` a ` and ` b ` are present in the
58
58
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.
62
67
63
68
The ` cfg!() ` syntax extension will be modified to accept cfg patterns as well.
64
69
A ` #[cfg_attr(<p>, <attr>)] ` syntax extension will be added
@@ -89,3 +94,9 @@ little readability gain.
89
94
90
95
How long should multiple ` #[cfg(...)] ` attributes on a single item be
91
96
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