Rust-version in a workspace
⚓ Rust 📅 2026-04-30 👤 surdeus 👁️ 1If you have a workspace with a bunch of crates in it, how do you maintain the rust-version fields?
In general I try to keep rust-version as low as possible, and only increase it if I actually use later language features or std features, or if dependencies require it. I do this on a crate-by-crate basis. This tends to lead to different rust-versions in different crates within the same workspace.
Where it gets a little murky to me is when I want to update dependencies. If I run cargo update --verbose and it tells me that a dependency is being held back due to MSRV, I figure that I need to look up which workspace crates use this dependency and update their MSRV until the resolver is happy and updates the dependency. For small workspaces this isn't a problem, but I just noticed this issue in a rather large project and figuring out which crates need to bump rust-version to satisfy the resolver is a little bit of a chore, and I'm not looking forward to this becoming a recurring maintenance thing.
I've thought about setting rust-version globally instead (in the workspace's Cargo.toml). The upside would be that I only need bump it once. The (very major) downside is that MSRV will be higher than it needs to be for some crates. This doesn't bother me for internal crates, but I won't want to do this for published crates.
How do you manage rust-version in workspace crates?
2 posts - 2 participants
🏷️ Rust_feed