I'm having a problem with the "build on save" feature in VSCode. (At least I think that's the feature.) When I save a source file, the OUTPUT window says
Running "cargo rustc -- -Zno-trans"
That command fails with
error: the option `Z` is only accepted on the nightly compiler
I have been unable to find where that command is set so that I can change it.
Actually, I would prefer to do "check on save," but I can't get that to work even with
I am using the rust-analyzer. Searching Settings for rust-analyzer.checkOnSave gives
Rust-analyzer › Check On Save: All Features
Check with all features (will be passed as --all-features). Defaults to rust-analyzer.cargo.allFeatures.
Rust-analyzer › Check On Save: All Targets
Check all targets and tests (will be passed as --all-targets)
Rust-analyzer › Check On Save: Command
Cargo command to use for cargo check
check
Rust-analyzer › Check On Save: Enable
Run specified cargo check command for diagnostics on save
Rust-analyzer › Check On Save: Extra Args
Extra arguments for cargo check
Rust-analyzer › Check On Save: Features
List of features to activate. Defaults to `rust-analyzer.cargo.features`.
Rust-analyzer › Check On Save: No Default Features
Do not activate the default feature
Rust-analyzer › Check On Save: Override Command
Advanced option, fully override the command rust-analyzer uses for checking. The command should include --message-format=json or similar option.
The box under All Targets is not checked. The items in my settings.json that refer to the rust-analyzer are
Well I'm not sure. I have a CheckOnSave.Command which I set to clippy, which means it runs cargo clippy on save. Maybe try with the Settings Screen without fiddling with the json?
cargo uninstall cargo-check
error: package ID specification `cargo-check` matched no packages
I've been using Rust for a long time, so it's possible that I have some old stuff lying around. I just don't know how to find it. If it helps, here's what's in my ~/.cargo/bin.