Skip to content

Commit 2768c73

Browse files
committed
unify
1 parent e1803db commit 2768c73

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

src/conditional-compilation.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,13 @@ r[cfg.predicate.literal]
6161

6262
r[cfg.predicate.version]
6363
* `version()` with a version number inside. It is true if the language version
64-
the compiler targets is higher or equal to the contained version number.
65-
It is false otherwise.
64+
the compiler targets is higher or equal to the contained version number. It is false otherwise.
65+
66+
r[cfg.predicate.version.syntax]
67+
The specified version has to follow either the `"a.b.c"` scheme or the `"a.b"` scheme. Semantically, assume `c` to be 0 if not present. Order wise, version numbers behave as if they were Rust tuples of type `(u16, u16, u16)`.
68+
69+
r[cfg.predicate.version.reserved]
70+
Invalid version literals will eval to false. This includes tuples with components that can't be represented as `u16`.
6671

6772
r[cfg.option-spec]
6873
_Configuration options_ are either names or key-value pairs, and are either set or unset.
@@ -308,19 +313,6 @@ r[cfg.proc_macro]
308313
Set when the crate being compiled is being compiled with the `proc_macro`
309314
[crate type].
310315

311-
r[cfg.version]
312-
### `version()`
313-
314-
r[cfg.version.behavior]
315-
The `version()` predicate evaluates to true if both:
316-
317-
* The version number contained inside follows the format and
318-
* The version number contained inside is less than or equal to the version
319-
of the language the compiler targets.
320-
321-
r[cfg.version.format]
322-
In order for it to be considered of valid format, the version number has to follow either the `"a.b.c"` scheme or the `"a.b"` scheme. Semantically, assume `c` to be 0 if not present. Order wise, version numbers behave as if they were Rust tuples of type `(u16, u16, u16)`.
323-
324316
r[cfg.panic]
325317
### `panic`
326318

0 commit comments

Comments
 (0)