Skip to content

rust-toolchain.toml: support multiple channels, or rather support nightly AND stable version. #4391

Description

@Sajjon

Problem

My team prefers cargo +nightly fmt for formatting over stable.

I have a different nightly installed locally than we have in CI, causing CI checks to fail. A solution would be to use rust-tooolchain.toml, alas we only want to use nightly for fmt.

Today rust-tooolchain.toml does not support this, but I would like it to be supported.

What do you think?

Proposed Solution

Bikeshedding syntax/overall idea:

[toolchain]
nightly = "2024-12-14"
stable = "1.87.0"

And then when I run cargo +nightly the "2024-12-14" version will be used. But for non-nightly commands "1.87.0" is used.

Notes

We can also omit either or, i.e. both:

[toolchain]
nightly = "2024-12-14"

and

[toolchain]
stable = "1.87.0"

are valid.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions