Skip to content

Commit e1d7030

Browse files
committed
Document "invalid channel name '[toolchain]'" error
It took me a while to figure this out. I got this error when building a project with rust-toolchain containing TOML and I had a fresh rustup, rust nightly etc. but still there were errors. Running rustup default stable rustup default nightly made it work for me. I'm not entirely sure if the explanation is totally accurate, of course.
1 parent ca0b042 commit e1d7030

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

doc/src/overrides.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Overrides
1+
[[#]] Overrides
22

33
`rustup` automatically determines which [toolchain] to use when one of the
44
installed commands like `rustc` is executed. There are several ways to control
@@ -97,6 +97,18 @@ just `nightly-2021-01-21`. The file has to be encoded in US-ASCII this case
9797
(if you are on Windows, check the encoding and that it does not start with a
9898
BOM). The legacy format is not available in `rust-toolchain.toml` files.
9999

100+
If you ever get an error like the following (when running `rustc`, `cargo` or
101+
other command)
102+
103+
```
104+
error: invalid channel name '[toolchain]' in '/PATH/TO/DIRECTORY/rust-toolchain'
105+
```
106+
107+
it means you're running `rustup` pre-1.23.0 (or just a default toolchain set by
108+
`rustup` pre-1.23.0) and trying to interact with a project that uses the new TOML
109+
encoding in the `rust-toolchain` file. You need to upgrade `rustup` to 1.23.0+
110+
and set the default toolchain again.
111+
100112
The `rust-toolchain.toml`/`rust-toolchain` files are suitable to check in to
101113
source control.
102114

0 commit comments

Comments
 (0)