-
Notifications
You must be signed in to change notification settings - Fork 531
Document #[cfg(version(...))] #1828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
r[cfg.predicate.version] | ||
* `version()` with a version number inside. It is true if the language version | ||
the compiler targets is higher or equal to the contained version number. | ||
It is false otherwise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs grammar, above, as for the other predicates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make sure to not wrap lines when adding new content?
r[cfg.version] | ||
## The `version()` predicate | ||
|
||
r[cfg.version.behaviour] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently using American English for the reference.
r[cfg.version.behaviour] | |
r[cfg.version.behavior] |
@@ -371,6 +395,12 @@ fn needs_not_foo() { | |||
// ... | |||
} | |||
|
|||
// This function is only included if the language version is newer than 1.50.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be "at least 1.50.0"? Or "greater than or equal to"?
r[cfg.version] | ||
## The `version()` predicate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems a little confusing to have both this and cfg.predicate.version
. I'm wondering if it would make sense to extend the "option" grammar to include version(...)
, and just remove cfg.predicate.version
? Then version()
would just be another option shown in the list here.
And the section header should probably be third level, and match the style of the other options.
r[cfg.version] | |
## The `version()` predicate | |
r[cfg.version] | |
### `version()` |
of the language the compiler targets. Usually the compiler version and | ||
language version match. So compiler version `1.50.0` targets language | ||
`1.50.0`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually the reference focuses on the language and not specifics about the compiler or specific implementations. The text here seems a little confusing in that regard. I would probably just strike this content.
of the language the compiler targets. Usually the compiler version and | |
language version match. So compiler version `1.50.0` targets language | |
`1.50.0`. | |
of the language the compiler targets. |
|
||
r[cfg.version.format] | ||
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, where `a,b,c` are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
follow either the `"a.b.c"` scheme or the `"a.b"` scheme, where `a,b,c` are | |
follow either the `"a.b.c"` scheme or the `"a.b"` scheme, where `a`, `b`, and `c` are |
Document
#[cfg(version(...))]
as it is to be stabilized.Tracking issue: rust-lang/rust#64796
RFC: rust-lang/rfcs#2523
Stabilization PR: rust-lang/rust#141137
Earlier documentation PR filed for the first attempt: #981