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
61
62
+
r[cfg.predicate.version]
63
+
*`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.
66
+
58
67
r[cfg.option-spec]
59
68
_Configuration options_ are either names or key-value pairs, and are either set or unset.
60
69
@@ -299,6 +308,19 @@ r[cfg.proc_macro]
299
308
Set when the crate being compiled is being compiled with the `proc_macro`
300
309
[crate type].
301
310
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
+
302
324
r[cfg.panic]
303
325
### `panic`
304
326
@@ -371,6 +393,12 @@ fn needs_not_foo() {
371
393
// ...
372
394
}
373
395
396
+
// This function is only included if the language version is at least 1.50.0
397
+
#[cfg(version("1.50.0"))]
398
+
fnneeds_new_compiler() {
399
+
// ...
400
+
}
401
+
374
402
// This function is only included when the panic strategy is set to unwind
0 commit comments