Skip to content

Commit 4165999

Browse files
committed
Unwrap conditional compilation
This unwraps the text to follow our style guide.
1 parent 45210cc commit 4165999

1 file changed

Lines changed: 19 additions & 49 deletions

File tree

src/conditional-compilation.md

Lines changed: 19 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ r[cfg.conditional]
3737
Whether to compile can depend on the target architecture of the compiled crate, arbitrary values passed to the compiler, and other things further described below.
3838

3939
r[cfg.predicate]
40-
Each form of conditional compilation takes a _configuration predicate_ that
41-
evaluates to true or false. The predicate is one of the following:
40+
Each form of conditional compilation takes a _configuration predicate_ that evaluates to true or false. The predicate is one of the following:
4241

4342
r[cfg.predicate.option]
4443
* A configuration option. The predicate is true if the option is set, and false if it is unset.
@@ -74,8 +73,7 @@ r[cfg.options.set]
7473
## Set configuration options
7574

7675
r[cfg.options.general]
77-
Which configuration options are set is determined statically during the
78-
compilation of the crate.
76+
Which configuration options are set is determined statically during the compilation of the crate.
7977

8078
r[cfg.options.target]
8179
Some options are _compiler-set_ based on data about the compilation.
@@ -84,8 +82,7 @@ r[cfg.options.other]
8482
Other options are _arbitrarily-set_ based on input passed to the compiler outside of the code.
8583

8684
r[cfg.options.crate]
87-
It is not possible to set a
88-
configuration option from within the source code of the crate being compiled.
85+
It is not possible to set a configuration option from within the source code of the crate being compiled.
8986

9087
> [!NOTE]
9188
> For `rustc`, arbitrary-set configuration options are set using the [`--cfg`] flag. Configuration values for a specified target can be displayed with `rustc --print cfg --target $TARGET`.
@@ -97,9 +94,7 @@ r[cfg.target_arch]
9794
### `target_arch`
9895

9996
r[cfg.target_arch.gen]
100-
Key-value option set once with the target's CPU architecture. The value is
101-
similar to the first element of the platform's target triple, but not
102-
identical.
97+
Key-value option set once with the target's CPU architecture. The value is similar to the first element of the platform's target triple, but not identical.
10398

10499
r[cfg.target_arch.values]
105100
Example values:
@@ -116,8 +111,7 @@ r[cfg.target_feature]
116111
### `target_feature`
117112

118113
r[cfg.target_feature.general]
119-
Key-value option set for each platform feature available for the current
120-
compilation target.
114+
Key-value option set for each platform feature available for the current compilation target.
121115

122116
r[cfg.target_feature.values]
123117
Example values:
@@ -130,19 +124,16 @@ Example values:
130124
* `"sse2"`
131125
* `"sse4.1"`
132126

133-
See the [`target_feature` attribute] for more details on the available
134-
features.
127+
See the [`target_feature` attribute] for more details on the available features.
135128

136129
r[cfg.target_feature.crt_static]
137-
An additional feature of `crt-static` is available to the
138-
`target_feature` option to indicate that a [static C runtime] is available.
130+
An additional feature of `crt-static` is available to the `target_feature` option to indicate that a [static C runtime] is available.
139131

140132
r[cfg.target_os]
141133
### `target_os`
142134

143135
r[cfg.target_os.general]
144-
Key-value option set once with the target's operating system. This value is
145-
similar to the second and third element of the platform's target triple.
136+
Key-value option set once with the target's operating system. This value is similar to the second and third element of the platform's target triple.
146137

147138
r[cfg.target_os.values]
148139
Example values:
@@ -162,9 +153,7 @@ r[cfg.target_family]
162153
### `target_family`
163154

164155
r[cfg.target_family.general]
165-
Key-value option providing a more generic description of a target, such as the family of the
166-
operating systems or architectures that the target generally falls into. Any number of
167-
`target_family` key-value pairs can be set.
156+
Key-value option providing a more generic description of a target, such as the family of the operating systems or architectures that the target generally falls into. Any number of `target_family` key-value pairs can be set.
168157

169158
r[cfg.target_family.values]
170159
Example values:
@@ -186,13 +175,7 @@ r[cfg.target_env]
186175
### `target_env`
187176

188177
r[cfg.target_env.general]
189-
Key-value option set with further disambiguating information about the target
190-
platform with information about the ABI or `libc` used. For historical reasons,
191-
this value is only defined as not the empty-string when actually needed for
192-
disambiguation. Thus, for example, on many GNU platforms, this value will be
193-
empty. This value is similar to the fourth element of the platform's target
194-
triple. One difference is that embedded ABIs such as `gnueabihf` will simply
195-
define `target_env` as `"gnu"`.
178+
Key-value option set with further disambiguating information about the target platform with information about the ABI or `libc` used. For historical reasons, this value is only defined as not the empty-string when actually needed for disambiguation. Thus, for example, on many GNU platforms, this value will be empty. This value is similar to the fourth element of the platform's target triple. One difference is that embedded ABIs such as `gnueabihf` will simply define `target_env` as `"gnu"`.
196179

197180
r[cfg.target_env.values]
198181
Example values:
@@ -209,13 +192,10 @@ r[cfg.target_abi]
209192
### `target_abi`
210193

211194
r[cfg.target_abi.general]
212-
Key-value option set to further disambiguate the target with information about
213-
the target ABI.
195+
Key-value option set to further disambiguate the target with information about the target ABI.
214196

215197
r[cfg.target_abi.disambiguation]
216-
For historical reasons, this value is only defined as not the empty-string when actually
217-
needed for disambiguation. Thus, for example, on many GNU platforms, this value will be
218-
empty.
198+
For historical reasons, this value is only defined as not the empty-string when actually needed for disambiguation. Thus, for example, on many GNU platforms, this value will be empty.
219199

220200
r[cfg.target_abi.values]
221201
Example values:
@@ -228,8 +208,7 @@ Example values:
228208
r[cfg.target_endian]
229209
### `target_endian`
230210

231-
Key-value option set once with either a value of "little" or "big" depending
232-
on the endianness of the target's CPU.
211+
Key-value option set once with either a value of "little" or "big" depending on the endianness of the target's CPU.
233212

234213
r[cfg.target_pointer_width]
235214
### `target_pointer_width`
@@ -262,12 +241,10 @@ r[cfg.target_has_atomic]
262241
### `target_has_atomic`
263242

264243
r[cfg.target_has_atomic.general]
265-
Key-value option set for each bit width that the target supports
266-
atomic loads, stores, and compare-and-swap operations.
244+
Key-value option set for each bit width that the target supports atomic loads, stores, and compare-and-swap operations.
267245

268246
r[cfg.target_has_atomic.stdlib]
269-
When this cfg is present, all of the stable [`core::sync::atomic`] APIs are available for
270-
the relevant atomic width.
247+
When this cfg is present, all of the stable [`core::sync::atomic`] APIs are available for the relevant atomic width.
271248

272249
r[cfg.target_has_atomic.values]
273250
Possible values:
@@ -282,22 +259,17 @@ Possible values:
282259
r[cfg.test]
283260
### `test`
284261

285-
Enabled when compiling the test harness. Done with `rustc` by using the
286-
[`--test`] flag. See [Testing] for more on testing support.
262+
Enabled when compiling the test harness. Done with `rustc` by using the [`--test`] flag. See [Testing] for more on testing support.
287263

288264
r[cfg.debug_assertions]
289265
### `debug_assertions`
290266

291-
Enabled by default when compiling without optimizations.
292-
This can be used to enable extra debugging code in development but not in
293-
production. For example, it controls the behavior of the standard library's
294-
[`debug_assert!`] macro.
267+
Enabled by default when compiling without optimizations. This can be used to enable extra debugging code in development but not in production. For example, it controls the behavior of the standard library's [`debug_assert!`] macro.
295268

296269
r[cfg.proc_macro]
297270
### `proc_macro`
298271

299-
Set when the crate being compiled is being compiled with the `proc_macro`
300-
[crate type].
272+
Set when the crate being compiled is being compiled with the `proc_macro` [crate type].
301273

302274
r[cfg.panic]
303275
### `panic`
@@ -448,9 +420,7 @@ Zero, one, or more attributes may be listed. Multiple attributes will each be ex
448420
r[cfg.macro]
449421
### The `cfg` macro
450422
451-
The built-in `cfg` macro takes in a single configuration predicate and evaluates
452-
to the `true` literal when the predicate is true and the `false` literal when
453-
it is false.
423+
The built-in `cfg` macro takes in a single configuration predicate and evaluates to the `true` literal when the predicate is true and the `false` literal when it is false.
454424
455425
For example:
456426

0 commit comments

Comments
 (0)