Skip to content

Accept TOML format in rust-toolchain #2438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,21 @@ source repository. This is most often the case for nightly-only
software that pins to a revision from the release archives.

In these cases the toolchain can be named in the project's directory
in a file called `rust-toolchain`, the content of which is the name of
a single `rustup` toolchain, and which is suitable to check in to
source control. This file has to be encoded in US-ASCII (if you are on
in a file called `rust-toolchain`, the content of which is either the name of
a single `rustup` toolchain, or a TOML file with the following layout:

``` toml
[toolchain]
channel = "nightly-2020-07-10"
components = [ "rustfmt", "rustc-dev" ]
targets = [ "wasm32-unknown-unknown", "thumbv2-none-eabi" ]
```

If the TOML format is used, the `[toolchain]` section is mandatory,
and at least one property must be specified.

The `rust-toolchain` file is suitable to check in to source control.
This file has to be encoded in US-ASCII (if you are on
Windows, check the encoding and that it does not starts with a BOM).

The toolchains named in this file have a more restricted form than
Expand Down
5 changes: 2 additions & 3 deletions src/cli/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,8 @@ pub fn list_toolchains(cfg: &Cfg, verbose: bool) -> Result<utils::ExitCode> {
String::new()
};
let cwd = utils::current_dir()?;
let ovr_toolchain_name = if let Ok(Some((ovr_toolchain, _reason))) = cfg.find_override(&cwd)
{
ovr_toolchain.name().to_string()
let ovr_toolchain_name = if let Ok(Some((toolchain, _reason))) = cfg.find_override(&cwd) {
toolchain.name().to_string()
} else {
String::new()
};
Expand Down
Loading