Rustup override for just one tool?

rustup override can be used to specify that, when you're working in some specific directory, you want to use some specific version of the Rust toolchain which is not your default.

I find myself wanting to do this for just one tool, not the entire toolchain. Specifically, I'm making some patches to an existing project that's supposed to stay compileable by stable Rust (so cargo build ought to use stable, which is my default anyway) but their rustfmt configuration uses a bunch of nightly-only tweaks (so cargo fmt should use nightly).

Is this already possible somehow? If it's not already possible, would the rustup developers consider a feature request to this end?

I know about cargo +nightly fmt but that's not supported by the pre-commit hooks the project is using (see pre-commit-rust#15).

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.