Skip to content

Commit 7bfbd3b

Browse files
Add details of each setting in the toolchain file
The format of the new section is modeled after the cargo docs, for example: https://doc.rust-lang.org/cargo/reference/profiles.html#profile-settings This is mostly a reorganization of the existing content to make it easier to scan for relevant details, but a few new details have also been added: 1. For `channel`, the format is now explained in the same format as in concepts/toolchains.md, but with the more limited form that `rust-toolchain.toml` accepts. This is based on the text that was here previously; I haven't verified if the code is actually this strict. 2. The `profile` section mentions that the default profile is not necessarily the profile named `default`, which is subtle detail that can be confusing. 3. The `components` section notes that the list is additive with the profile's list of components. 4. The `targets` field is now documented, previously it wasn't mentioned other than to say it's ignored with `path`.
1 parent 8f6b536 commit 7bfbd3b

File tree

1 file changed

+60
-13
lines changed

1 file changed

+60
-13
lines changed

doc/src/overrides.md

Lines changed: 60 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -113,23 +113,70 @@ that uses the new TOML encoding in the `rust-toolchain` file. You need to upgrad
113113
The `rust-toolchain.toml`/`rust-toolchain` files are suitable to check in to
114114
source control.
115115

116-
The toolchains named in these files have a more restricted form than `rustup`
117-
toolchains generally, and may only contain the names of the three release
118-
channels, 'stable', 'beta', 'nightly', Rust version numbers, like '1.0.0', and
119-
optionally an archive date, like 'nightly-2017-01-01'. They may not name
120-
custom toolchains, nor host-specific toolchains. To use a custom local
121-
toolchain, you can instead use a `path` toolchain:
116+
### Toolchain file settings
122117

123-
``` toml
124-
[toolchain]
125-
path = "/path/to/local/toolchain"
118+
#### channel
119+
120+
The `channel` setting specifies which [toolchain] to use. The value is a
121+
string in the following form:
122+
123+
```
124+
<channel>[-<date>]
125+
126+
<channel> = stable|beta|nightly|<major.minor.patch>
127+
<date> = YYYY-MM-DD
126128
```
127129

130+
Note that this is a more restricted form than `rustup` toolchains
131+
generally, and cannot be used to specify custom toolchains or
132+
host-specific toolchains.
133+
134+
[toolchain]: concepts/toolchains.md
135+
136+
#### path
137+
138+
The `path` setting allows a custom toolchain to be used. The value is a
139+
path string. A relative path is resolved relative to the location of the
140+
`rust-toolchain.toml` file.
141+
128142
Since a `path` directive directly names a local toolchain, other options
129-
like `components`, `targets`, and `profile` have no effect. `channel`
130-
and `path` are mutually exclusive, since a `path` already points to a
131-
specific toolchain. A relative `path` is resolved relative to the
132-
location of the `rust-toolchain.toml` file.
143+
like `components`, `targets`, and `profile` have no effect.
144+
145+
`channel` and `path` are mutually exclusive, since a `path` already
146+
points to a specific toolchain.
147+
148+
#### profile
149+
150+
The `profile` setting names a group of components to be installed. The
151+
value is a string. The valid options are: `minimal`, `default`, and
152+
`complete`. See [profiles] for details of each.
153+
154+
Note that if not specified, the `default` profile is not necessarily
155+
used, as a different default profile might have been set with `rustup
156+
set profile`.
157+
158+
[profiles]: concepts/profiles.md
159+
160+
#### components
161+
162+
The `components` setting contains a list of additional components to
163+
install. The value is a list of strings. See [components] for a list of
164+
components. Note that different toolchains may have different components
165+
available.
166+
167+
The components listed here are additive with the current profile.
168+
169+
[components]: concepts/components.md
170+
171+
#### targets
172+
173+
The `targets` setting contains a list of platforms to install for
174+
[cross-compilation]. The value is a list of strings.
175+
176+
The host platform is automatically included; the targets listed here are
177+
additive.
178+
179+
[cross-compilation]: https://rust-lang.github.io/rustup/cross-compilation.html
133180

134181
## Default toolchain
135182

0 commit comments

Comments
 (0)