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