@@ -69,7 +69,7 @@ functionality already exists in the language, but quickly grows out of reasonabl
69
69
# Guide-level explanation
70
70
[ guide-level-explanation ] : #guide-level-explanation
71
71
72
- Where clauses can use cfg-attributes on individual bounds, like so:
72
+ ` where ` clauses can use cfg-attributes on individual trait bounds, like so:
73
73
74
74
``` rust
75
75
impl <T > SomeTrait <T > for Thing
90
90
T : SomeRequirementB ,
91
91
{}
92
92
```
93
- and in other situations where where clauses apply.
93
+ and in other situations where ` where ` clauses apply.
94
94
95
95
During compilation, all cfg-attributes on a where bound are evaluated. If the evaluation result is false, then the bound in question is not
96
96
compiled and the bound does not apply to the given type. This may cause errors if code that relies on those bounds is not itself also
@@ -101,8 +101,8 @@ fields or on function signatures.
101
101
[ reference-level-explanation ] : #reference-level-explanation
102
102
103
103
In positions that accept where clauses, such as trait implementations and function signatures, individual clauses can now be decorated with
104
- cfg-attributes. The cfg-attribute must be on the left hand of the colon (e.g. ` #[cfg(...]) T: Foo ` rather than ` T: #[cfg(...)] Foo ` ) and
105
- apply for that one bound, up to the comma or end of the where section. Each bound collection will be conditionally compiled depending on the
104
+ cfg-attributes. The cfg-attribute must be on the left hand of the colon (e.g. ` #[cfg(...)] T: Foo ` rather than ` T: #[cfg(...)] Foo ` ) and
105
+ applies to that one bound, up to the comma or end of the where section. Each bound collection will be conditionally compiled depending on the
106
106
conditions specified in the cfg arguments. Note that this may cause a where clause to conditionally compile as having no bound entries
107
107
(i.e. an empty where clause), but this has been allowed in Rust since 1.16 and already occurs from time to time when using macros.
108
108
0 commit comments