Skip to content

Commit 5ce29ce

Browse files
committed
Updates based on feedback in the pull request
1 parent 49dfd2a commit 5ce29ce

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

text/3349-cfg-os-version.md renamed to text/3379-cfg-os-version.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ For instance, the standard library's Windows Mutex implementation could potentia
1313
```rust
1414
pub unsafe fn unlock(&self) {
1515
*self.held.get() = false;
16-
if cfg!(os_version_min("6.1.7600")) { // `cfg!(os_version_min("Windows7"))` is also possible
16+
if cfg!(os_version_min("windows", "6.1.7600")) { // `cfg!(os_version_min("Windows7"))` is also possible
1717
c::ReleaseSRWLockExclusive(raw(self))
1818
} else {
1919
match kind() {
@@ -66,7 +66,7 @@ pub unsafe fn unlock(&self) {
6666
}
6767
```
6868

69-
Crate authors can set the API requirements of their Cargo configuration file under the [`target key`](https://doc.rust-lang.org/cargo/reference/config.html#target) like so (suggested variable name/syntax only):
69+
Crate authors can set the API requirements of their Cargo manifest file under the [`target key`](https://doc.rust-lang.org/cargo/reference/config.html#target) like so (suggested variable name/syntax only):
7070

7171
```toml
7272
[target.x86_64-pc-windows-msvc]
@@ -75,7 +75,7 @@ min_os_version_windows = "6.0.6000" # Vista
7575

7676
When compiling, the user can provide the API levels to compile for: `rustc --cfg 'target_os_version.windows="6.0.6000"'`.
7777

78-
If an end user sets their `os_version.windows` to an incompatible version then the user receives an error. For instance, in the example above where the user is setting their `min_os_version_windows` to Windows Vista, they will receive an error when linking with the standard library which imposes Windows 7 as its minimum `os_version.windows` by default for the `x86_64-pc-windows-msvc` target.
78+
If an end user sets their `target_os_version.windows` to an incompatible version then the user receives an error. For instance, in the example above where the user is setting their `min_os_version_windows` to Windows Vista, they will receive an error when linking with the standard library which imposes Windows 7 as its minimum `target_os_version.windows` by default for the `x86_64-pc-windows-msvc` target.
7979

8080
If a library does not explicitly set its `min_os_target_windows` value, it will automatically be set to the largest `min_windows_build_version` of all of its transitive dependencies.
8181

@@ -90,15 +90,15 @@ These predicates do not assume any semantic versioning information. The specifie
9090
**Note:** Here it would be important to link to documentation showing the `cfg` predicates and the different version strings that are supported.
9191

9292

93-
# Reference-level explanation
94-
[reference-level-explanation]: #reference-level-explanation
93+
# Implementation
94+
[implementation]: #implementation
9595

9696
The various target API version `cfg` predicates allow users to conditionally compile code based on the API version supported by the target platform. Each platform is responsible for defining a default key, a set of keys it supports, and functions that are able to compare the version strings they use. A set of comparison functions can be provided by `rustc` for common formats such as 2- and 3-part semantic versioning. When a platform detects a key it doesn’t support it will return `false` and emit a warning.
9797

9898
When a target is being built the actual API versions will be set via the following methods, in decreasing order of precedence:
99-
* Command line
99+
* Command line arguments to `rustc` and/or `cargo`
100100
* Cargo.toml target sections
101-
* Target platform defaults
101+
* Target platform defaultsi
102102

103103
## Versioning Schema
104104

@@ -115,7 +115,7 @@ The functions for parsing and comparing version strings will need to be updated
115115
# Drawbacks
116116
[drawbacks]: #drawbacks
117117

118-
Based on the outcome of various discussions around this RFC it may be necessary to make non-backwards-compatible changes to various parts of `rustc`. If this occurs older versions of the compiler will not be able to handle crates that make use of these new features.
118+
Each supported platform will need to implement version string parsing logic (or re-use some provided defaults), maintain the logic in response to future changes, and update any version alias tables.
119119

120120
# Rationale and alternatives
121121
[rationale-and-alternatives]: #rationale-and-alternatives

0 commit comments

Comments
 (0)