Skip to content

Commit 1d9058f

Browse files
committed
Auto merge of #14224 - epage:msrv, r=weihanglo
docs(ref): Note MSRV for features in the docs I mostly focused on manifests and build scripts as those seemed the highest priority. I also went back only so far, assuming these would be the highest value items.
2 parents 471287f + 9262ae4 commit 1d9058f

File tree

5 files changed

+24
-9
lines changed

5 files changed

+24
-9
lines changed

src/doc/src/reference/build-scripts.md

+8-9
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,6 @@ Build scripts communicate with Cargo by printing to stdout. Cargo will
7777
interpret each line that starts with `cargo::` as an instruction that will
7878
influence compilation of the package. All other lines are ignored.
7979

80-
> **Note:** The old invocation prefix `cargo:` (one colon only) is deprecated
81-
> and won't get any new features. To migrate, use two-colons prefix `cargo::`,
82-
> which was added in Rust 1.77. If you were using `cargo:KEY=VALUE` for
83-
> arbitrary links manifest key-value pairs, it is encouraged to switch to
84-
> `cargo::metadata=KEY=VALUE`. Stick to `cargo:` only if the support of Rust
85-
> version older than 1.77 is required.
86-
8780
> The order of `cargo::` instructions printed by the build script *may*
8881
> affect the order of arguments that `cargo` passes to `rustc`. In turn, the
8982
> order of arguments passed to `rustc` may affect the order of arguments passed
@@ -140,6 +133,9 @@ one detailed below.
140133
* [`cargo::metadata=KEY=VALUE`](#the-links-manifest-key) --- Metadata, used by `links`
141134
scripts.
142135

136+
> **MSRV:** 1.77 is required for `cargo::KEY=VALUE` syntax.
137+
> To support older versions, use the `cargo:KEY=VALUE` syntax.
138+
143139
### `cargo::rustc-link-arg=FLAG` {#rustc-link-arg}
144140

145141
The `rustc-link-arg` instruction tells Cargo to pass the [`-C link-arg=FLAG`
@@ -264,8 +260,6 @@ the _reachable_ cfg expressions with the [`unexpected_cfgs`][unexpected-cfgs] li
264260
The syntax of `CHECK_CFG` mirrors the `rustc` [`--check-cfg` flag][option-check-cfg], see
265261
[Checking conditional configurations][checking-conditional-configurations] for more details.
266262

267-
> Note: `cargo:rustc-check-cfg` (single-colon) can be used if your MSRV is below Rust 1.77
268-
269263
The instruction can be used like this:
270264

271265
```rust,no_run
@@ -286,6 +280,8 @@ avoid typos, missing check-cfg, stale cfgs...
286280
See also the
287281
[conditional compilation][conditional-compilation-example] example.
288282

283+
> **MSRV:** Respected as of 1.80
284+
289285
[checking-conditional-configurations]: ../../rustc/check-cfg.html
290286
[option-check-cfg]: ../../rustc/command-line-arguments.md#option-check-cfg
291287
[conditional-compilation-example]: build-script-examples.md#conditional-compilation
@@ -430,6 +426,9 @@ used.
430426
Note that metadata is only passed to immediate dependents, not transitive
431427
dependents.
432428

429+
> **MSRV:** 1.77 is required for `cargo::metadata=KEY=VALUE`.
430+
> To support older versions, use `cargo:KEY=VAUE` (unsupported directives are assumed to be metadata keys).
431+
433432
[using-another-sys]: build-script-examples.md#using-another-sys-crate
434433

435434
## `*-sys` Packages

src/doc/src/reference/external-tools.md

+2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ details.
5454
If you are using Rust, the [cargo_metadata] crate can be used to parse these
5555
messages.
5656

57+
> **MSRV:** 1.77 is required for `package_id` to be a Package ID Specification. Before that, it was opaque.
58+
5759
[build command documentation]: ../commands/cargo-build.md
5860
[cargo_metadata]: https://crates.io/crates/cargo_metadata
5961
[Package ID Specifications]: ./pkgid-spec.md

src/doc/src/reference/manifest.md

+6
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ breaking change.
111111

112112
This field is optional and defaults to `0.0.0`. The field is required for publishing packages.
113113

114+
> **MSRV:** Before 1.75, this field was required
115+
114116
[Resolver]: resolver.md
115117
[SemVer compatibility]: semver.md
116118

@@ -189,6 +191,8 @@ To find the minimum `rust-version` compatible with your project, you can use thi
189191

190192
When used on packages that get published, we recommend [verifying the `rust-version`](../guide/continuous-integration.md#verifying-rust-version).
191193

194+
> **MSRV:** Respected as of 1.56
195+
192196
### The `description` field
193197

194198
The description is a short blurb about the package. [crates.io] will display
@@ -589,6 +593,8 @@ Cargo only applies these to the current package and not to dependencies.
589593
As for dependents, Cargo suppresses lints from non-path dependencies with features like
590594
[`--cap-lints`](../../rustc/lints/levels.html#capping-lints).
591595

596+
> **MSRV:** Respected as of 1.74
597+
592598
## The `[badges]` section
593599

594600
The `[badges]` section is for specifying status badges that can be displayed

src/doc/src/reference/profiles.md

+2
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ For more information on what each option does see `rustc`'s docs on [debuginfo].
7878
You may wish to also configure the [`split-debuginfo`](#split-debuginfo) option
7979
depending on your needs as well.
8080

81+
> **MSRV:** 1.71 is required for `none`, `limited`, `full`, `line-directives-only`, and `line-tables-only`
82+
8183
[`-C debuginfo` flag]: ../../rustc/codegen-options/index.html#debuginfo
8284
[debuginfo]: ../../rustc/codegen-options/index.html#debuginfo
8385
[profiling]: https://reviews.llvm.org/D46061

src/doc/src/reference/workspaces.md

+6
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ description.workspace = true
191191
documentation.workspace = true
192192
```
193193

194+
> **MSRV:** Requires 1.74+
195+
194196
## The `dependencies` table
195197

196198
The `workspace.dependencies` table is where you define dependencies to be
@@ -230,6 +232,8 @@ cc.workspace = true
230232
rand.workspace = true
231233
```
232234

235+
> **MSRV:** Requires 1.74+
236+
233237
## The `lints` table
234238

235239
The `workspace.lints` table is where you define lint configuration to be inherited by members of a workspace.
@@ -257,6 +261,8 @@ version = "0.1.0"
257261
workspace = true
258262
```
259263

264+
> **MSRV:** Respected as of 1.74
265+
260266
## The `metadata` table
261267

262268
The `workspace.metadata` table is ignored by Cargo and will not be warned

0 commit comments

Comments
 (0)