Rustup: Optional `.toml` extension for `rust-toolchain` file?

Created on 7 Feb 2021  路  4Comments  路  Source: rust-lang/rustup

Describe the problem you are trying to solve

The rust-toolchain file accepts TOML syntax since https://github.com/rust-lang/rustup/pull/2438, but it still can't have a toml file extension (i.e. rust-toolchain.toml). Thus, the used markup language is not clear to both users and IDEs.

Describe the solution you'd like

Allow an optional .toml extension for the file so that both rust-toolchain and rust-toolchain.toml are valid.

Notes

A similar approach was taken for Cargo's .cargo/config files, which now can be named .cargo/config.toml too: https://github.com/rust-lang/cargo/pull/7295

E-mentor enhancement help wanted

Most helpful comment

I agree on both points. Should I try to send a PR for this?

All 4 comments

If we were to do this, I'd want to say:

  1. The rust-toolchain.toml file must ONLY support the toml style content
  2. If both are present, use rust-toolchain and emit a warning that rust-toolchain.toml is being ignored

This would match the cargo PR in the top post.

I agree on both points. Should I try to send a PR for this?

Sure, if you want to discuss it you can find me on discord too.

Great! I already started looking into it and I'll send a PR in a moment.

_Edit:_ I opened https://github.com/rust-lang/rustup/pull/2653.

Was this page helpful?
0 / 5 - 0 ratings