@@ -8,14 +8,14 @@ and override which toolchain is used:
8
8
+beta`.
9
9
2 . The ` RUSTUP_TOOLCHAIN ` environment variable.
10
10
3 . A [ directory override] , set with the ` rustup override ` command.
11
- 4 . The [ ` rust-toolchain ` ] file.
11
+ 4 . The [ ` rust-toolchain.toml ` ] file.
12
12
5 . The [ default toolchain] .
13
13
14
14
The toolchain is chosen in the order listed above, using the first one that is
15
15
specified. There is one exception though: directory overrides and the
16
- ` rust-toolchain ` file are also preferred by their proximity to the current
16
+ ` rust-toolchain.toml ` file are also preferred by their proximity to the current
17
17
directory. That is, these two override methods are discovered by walking up
18
- the directory tree toward the filesystem root, and a ` rust-toolchain ` file
18
+ the directory tree toward the filesystem root, and a ` rust-toolchain.toml ` file
19
19
that is closer to the current directory will be preferred over a directory
20
20
override that is further away.
21
21
@@ -24,7 +24,7 @@ To verify which toolchain is active use `rustup show`.
24
24
[ toolchain ] : concepts/toolchains.md
25
25
[ toolchain override shorthand ] : #toolchain-override-shorthand
26
26
[ directory override ] : #directory-overrides
27
- [ `rust-toolchain` ] : #the-toolchain-file
27
+ [ `rust-toolchain.toml ` ] : #the-toolchain-file
28
28
[ default toolchain ] : #default-toolchain
29
29
30
30
## Toolchain override shorthand
@@ -74,8 +74,11 @@ case for nightly-only software that pins to a revision from the release
74
74
archives.
75
75
76
76
In these cases the toolchain can be named in the project's directory in a file
77
- called ` rust-toolchain ` , the content of which is either the name of a single
78
- ` rustup ` toolchain, or a TOML file with the following layout:
77
+ called ` rust-toolchain.toml ` or ` rust-toolchain ` . If both files are present in
78
+ a directory, the latter is used for backwards compatibility. The files use the
79
+ [ TOML] format and have the following layout:
80
+
81
+ [ TOML ] : https://toml.io/
79
82
80
83
``` toml
81
84
[toolchain ]
@@ -85,14 +88,19 @@ targets = [ "wasm32-unknown-unknown", "thumbv2-none-eabi" ]
85
88
profile = " minimal"
86
89
```
87
90
88
- If the TOML format is used, the ` [toolchain] ` section is mandatory, and at
89
- least one property must be specified.
91
+ The ` [toolchain] ` section is mandatory, and at least one property must be
92
+ specified.
93
+
94
+ For backwards compatibility, ` rust-toolchain ` files also support a legacy
95
+ format that only contains a toolchain name without any TOML encoding, e.g.
96
+ just ` nightly-2021-01-21 ` . The file has to be encoded in US-ASCII this case
97
+ (if you are on Windows, check the encoding and that it does not starts with a
98
+ BOM). The legacy format is not available in ` rust-toolchain.toml ` files.
90
99
91
- The ` rust-toolchain ` file is suitable to check in to source control. This file
92
- has to be encoded in US-ASCII (if you are on Windows, check the encoding and
93
- that it does not starts with a BOM).
100
+ The ` rust-toolchain.toml ` /` rust-toolchain ` files are suitable to check in to
101
+ source control.
94
102
95
- The toolchains named in this file have a more restricted form than ` rustup `
103
+ The toolchains named in these files have a more restricted form than ` rustup `
96
104
toolchains generally, and may only contain the names of the three release
97
105
channels, 'stable', 'beta', 'nightly', Rust version numbers, like '1.0.0', and
98
106
optionally an archive date, like 'nightly-2017-01-01'. They may not name
0 commit comments