Skip to content

Commit 1652c3b

Browse files
committed
docs(ref): Split rust-version into its own chapter
1 parent a06986c commit 1652c3b

File tree

3 files changed

+32
-25
lines changed

3 files changed

+32
-25
lines changed

src/doc/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* [Overriding Dependencies](reference/overriding-dependencies.md)
2424
* [The Manifest Format](reference/manifest.md)
2525
* [Cargo Targets](reference/cargo-targets.md)
26+
* [Rust version](reference/rust-version.md)
2627
* [Workspaces](reference/workspaces.md)
2728
* [Features](reference/features.md)
2829
* [Features Examples](reference/features-examples.md)

src/doc/src/reference/manifest.md

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Every manifest file consists of the following sections:
1212
* [`version`](#the-version-field) --- The version of the package.
1313
* [`authors`](#the-authors-field) --- The authors of the package.
1414
* [`edition`](#the-edition-field) --- The Rust edition.
15-
* [`rust-version`](#the-rust-version-field) --- The minimal supported Rust version.
15+
* [`rust-version`](rust-version.md) --- The minimal supported Rust version.
1616
* [`description`](#the-description-field) --- A description of the package.
1717
* [`documentation`](#the-documentation-field) --- URL of the package documentation.
1818
* [`readme`](#the-readme-field) --- Path to the package's README file.
@@ -163,31 +163,9 @@ will have `edition` explicitly specified to a newer value.
163163

164164
### The `rust-version` field
165165

166-
The `rust-version` field is an optional key that tells cargo what version of the
166+
The `rust-version` field tells cargo what version of the
167167
Rust language and compiler your package can be compiled with.
168-
If the currently selected version of the Rust compiler is older than the stated
169-
version, cargo will exit with an error, telling the user what version is
170-
required.
171-
This affects all targets/crates in the package, including test suites,
172-
benchmarks, binaries, examples, etc.
173-
174-
The `rust-version` may be ignored using the `--ignore-rust-version` option.
175-
176-
```toml
177-
[package]
178-
# ...
179-
rust-version = "1.56"
180-
```
181-
182-
The Rust version must be a bare version number with at least one component; it
183-
cannot include semver operators or pre-release identifiers. Compiler pre-release
184-
identifiers such as -nightly will be ignored while checking the Rust version.
185-
186-
To find the minimum `rust-version` compatible with your project, you can use third-party tools like [`cargo-msrv`](https://crates.io/crates/cargo-msrv).
187-
188-
When used on packages that get published, we recommend [verifying the `rust-version`](../guide/continuous-integration.md#verifying-rust-version).
189-
190-
> **MSRV:** Respected as of 1.56
168+
See [the Rust version chapter](rust-version.md) for more detail.
191169

192170
### The `description` field
193171

@@ -685,6 +663,7 @@ more detail.
685663
"#the-exclude-and-include-fields-optional": "manifest.html#the-exclude-and-include-fields",
686664
"#the-publish--field-optional": "manifest.html#the-publish-field",
687665
"#the-metadata-table-optional": "manifest.html#the-metadata-table",
666+
"#rust-version": "rust-version.html",
688667
};
689668
var target = fragments[window.location.hash];
690669
if (target) {

src/doc/src/reference/rust-version.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Rust Version
2+
3+
The `rust-version` field is an optional key that tells cargo what version of the
4+
Rust language and compiler your package can be compiled with.
5+
If the currently selected version of the Rust compiler is older than the stated
6+
version, cargo will exit with an error, telling the user what version is
7+
required.
8+
This affects all targets/crates in the package, including test suites,
9+
benchmarks, binaries, examples, etc.
10+
11+
The `rust-version` may be ignored using the `--ignore-rust-version` option.
12+
13+
```toml
14+
[package]
15+
# ...
16+
rust-version = "1.56"
17+
```
18+
19+
The Rust version must be a bare version number with at least one component; it
20+
cannot include semver operators or pre-release identifiers. Compiler pre-release
21+
identifiers such as -nightly will be ignored while checking the Rust version.
22+
23+
To find the minimum `rust-version` compatible with your project, you can use third-party tools like [`cargo-msrv`](https://crates.io/crates/cargo-msrv).
24+
25+
When used on packages that get published, we recommend [verifying the `rust-version`](../guide/continuous-integration.md#verifying-rust-version).
26+
27+
> **MSRV:** Respected as of 1.56

0 commit comments

Comments
 (0)