I use nightly Rust in rust-toolchain.toml to get the nightly version of tools (clippy, rust-analyzer, rustfmt):
toolchain.channel = "nightly-2025-08-24"
But my project is supposed to build on stable rust 1.88. To do this, I set rust-version (MSRV) in Cargo.toml:
[package]
rust-version = "1.88"
In my CI I want to use toolchain of rust-version (stable) for these workflows:
cargo check
cargo test --workspace
And use the toolchain from rust-toolchain.toml for these workflows:
cargo clippy -- -D warnings (rust-toolchain.toml)
cargo fmt --check (rust-toolchain.toml)
To do that, I need to duplicate the entire components field from rust-toolchain.toml and I also duplicate the MSRV in the workflows. It would be nice to have a single source of truth for versions
Wanted behaviour
An input to the workflow to specify that I want the rust-version in Cargo.toml to override the version specified in rust-toolchain.toml. components field in rust-toolchain.toml should still be read.
I use your workflow in all of my projects, and I love it! Thanks for making it.
I use nightly Rust in
rust-toolchain.tomlto get the nightly version of tools (clippy, rust-analyzer, rustfmt):But my project is supposed to build on stable rust
1.88. To do this, I setrust-version(MSRV) inCargo.toml:In my CI I want to use toolchain of
rust-version(stable) for these workflows:cargo checkcargo test --workspaceAnd use the toolchain from
rust-toolchain.tomlfor these workflows:cargo clippy -- -D warnings(rust-toolchain.toml)cargo fmt --check(rust-toolchain.toml)To do that, I need to duplicate the entire
componentsfield fromrust-toolchain.tomland I also duplicate the MSRV in the workflows. It would be nice to have a single source of truth for versionsWanted behaviour
An input to the workflow to specify that I want the
rust-versioninCargo.tomlto override the version specified inrust-toolchain.toml.componentsfield inrust-toolchain.tomlshould still be read.I use your workflow in all of my projects, and I love it! Thanks for making it.