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
Copy file name to clipboardExpand all lines: text/3857-cfg-version.md
+15-11Lines changed: 15 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -258,7 +258,7 @@ This will be reported back through `--print-cfg`.
258
258
Because this gets reported back in `--print-cfg`,
259
259
Cargo will expose `rust` in:
260
260
- build scripts as `CARGO_CFG_RUST`
261
-
-`target."cfg()".dependencies`
261
+
-`[target."cfg()".dependencies]`
262
262
263
263
## clippy
264
264
@@ -268,7 +268,7 @@ However, it will be perfectly reasonable to use those items when guarded by a `#
268
268
269
269
Clippy may wish to:
270
270
- Find a way to reduce false positives, e.g. evaluating the `cfg(since)`s that led to the item's usage or disabling the lint within `#[cfg(since)]`
271
-
- Suggest `#[cfg(since)]` in the `clippy::incompatible_msrv` diagnostic report (maybe along with offering to bump MSRV)
271
+
- Suggest `#[cfg(since)]` in the `clippy::incompatible_msrv` diagnostic report (maybe along with offering to bump MSRV as that is a reasonable alternative)
272
272
273
273
# Drawbacks
274
274
[drawbacks]: #drawbacks
@@ -292,7 +292,7 @@ Libraries could having ticking time bombs that accidentally break or have undesi
292
292
293
293
## `since` cfg predicate
294
294
295
-
We could offer a `before`operator but that is already covered by `not(since)`.
295
+
We could offer a `before`predicate but that is already covered by `not(since)`.
296
296
297
297
The `since` name was taken from
298
298
[rustversion](https://crates.io/crates/rustversion) and the `#[deprecated(since)]` / `#[stable(since)]` attributes.
@@ -331,11 +331,11 @@ in case we want the future possibility of relaxing SemVer versions
331
331
We could have the `check-cfg``since` predicate only apply to the `cfg``since` predicate,
332
332
causing `#[cfg(rust = "1.100.0")]` to warn.
333
333
However,
334
-
- the `since` predicates are a general feature intended to be used with other version numbers where exact matches may be appropriate.
334
+
- the `since` predicates are a general feature intended to be used with other version numbers where exact matches may also be appropriate.
335
335
- this would get in the way of approximating the vendor version by the language version for working around compiler bugs and snapshotting of compiler output.
336
336
337
337
Possibly there could be a clippy lint specifically about `rust = "<something>"`.
338
-
Alternatively, we could try to find a way to structure `--check-cfg` to allow the person defining the `cfg` to decide whether it can be use with `=` or not.
338
+
Alternatively, we could try to find a way to structure `--check-cfg` to allow the person defining the `cfg` to decide whether it can be used with `=` or not.
339
339
One way of doing this is by allowing the `check-cfg``since` predicate outside of the `values` predicate,
340
340
meaning it works with the `cfg``since` predicate and not the `=` operator.
341
341
Another way would be for the `check-cfg``since` predicate to never work with `=` but to instead
@@ -363,7 +363,7 @@ To allow checking for the presence of `rust`, add the following to your `Cargo.t
@@ -400,7 +404,7 @@ For RFC 2523, they settled on pre-releases being incomplete,
400
404
favoring maintainers to adopt stabilized-on-nightly features immediately
401
405
while letting people on pinned nightlies or bisecting nightlies to set a `-Z` to mark the version as incomplete.
402
406
403
-
In this RFC, we settled translating `-nightly` to `-incomplete` because:
407
+
In this RFC, we settled on translating `-nightly` to `-incomplete` because:
404
408
- Maintainers can adopt stabilized-on-nightly features with `#[cfg(since(rust, "1.100.0-0"))]` (the lowest pre-release for `1.100.0`), keeping friction low while explicitly acknowledging that the unstable feature may change
405
409
- Allows build scripts to experiment with other logic without less chance of needing to invoke `rustc` (e.g. detecting nightly)
406
410
- It provides extra context when approximating the vendor version from the language version when populating build information
0 commit comments