You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*`true` or `false` literals, which are always true or false respectively.
57
66
67
+
r[cfg.predicate.version]
68
+
*`version()` with a version number inside. It is true if the language version
69
+
the compiler targets is higher or equal to the contained version number.
70
+
It is false otherwise.
71
+
58
72
r[cfg.option-spec]
59
73
_Configuration options_ are either names or key-value pairs, and are either set or unset.
60
74
@@ -299,6 +313,19 @@ r[cfg.proc_macro]
299
313
Set when the crate being compiled is being compiled with the `proc_macro`
300
314
[crate type].
301
315
316
+
r[cfg.version]
317
+
### `version()`
318
+
319
+
r[cfg.version.behavior]
320
+
The `version()` predicate evaluates to true if both:
321
+
322
+
* The version number contained inside follows the format and
323
+
* The version number contained inside is less than or equal to the version
324
+
of the language the compiler targets.
325
+
326
+
r[cfg.version.format]
327
+
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)`.
328
+
302
329
r[cfg.panic]
303
330
### `panic`
304
331
@@ -371,6 +398,12 @@ fn needs_not_foo() {
371
398
// ...
372
399
}
373
400
401
+
// This function is only included if the language version is newer than 1.50.0
402
+
#[cfg(version("1.50.0"))]
403
+
fnneeds_new_compiler() {
404
+
// ...
405
+
}
406
+
374
407
// This function is only included when the panic strategy is set to unwind
0 commit comments