Verification
Problem
- Cargo has dynamic completions for shells.
- Rustup respects
rust-toolchain(.toml).
- ☝🏻this is conflict
rustup default nightly; rustup uninstall stable;
echo "toolchain.channel = \"stable\"" > rust-toolchain.toml
CARGO_COMPLETE=fish cargo -
# then rustup installs stable toolchain :(
# my shell (fish) completion function: `source (CARGO_COMPLETE=fish cargo | psub)`
Steps
rustup default nightly
echo "toolchain.channel = \"not-yet-installed-toolchain\"" > rust-toolchain.toml
CARGO_COMPLETE=fish cargo -
Possible Solution(s)
My workaround:
source (CARGO_COMPLETE=fish RUSTUP_TOOLCHAIN="nightly" cargo +nightly | psub)
Notes
I suppose rustup should not respects overrides (rust-toolchain(.toml)) if called with non-empty env CARGO_COMPLETE.
Update (thanks, @djc): source (RUSTUP_AUTO_INSTALL=0 CARGO_COMPLETE=fish cargo | psub)
Rustup version
rustup 1.29.0 (28d1352db 2026-03-05)
Installed toolchains
OS version
Verification
Problem
rust-toolchain(.toml).Steps
rustup default nightlyecho "toolchain.channel = \"not-yet-installed-toolchain\"" > rust-toolchain.tomlCARGO_COMPLETE=fish cargo -Possible Solution(s)
My workaround:
Notes
I suppose rustup should not respects overrides (
rust-toolchain(.toml)) if called with non-empty envCARGO_COMPLETE.Update (thanks, @djc):
source (RUSTUP_AUTO_INSTALL=0 CARGO_COMPLETE=fish cargo | psub)Rustup version
rustup 1.29.0 (28d1352db 2026-03-05)Installed toolchains
nightly onlyOS version
macOs 15.7.7