You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Check $CARGO before $PATH
Currently, clippy will ignore $CARGO when spawning cargo commands, which can be problematic for `cargo clippy` and interop with other tools. This commit induces clippy to respect $CARGO in every case it seems likely to matter.
Fixes:
- #11943
changelog: clippy now respects setting the `CARGO` environment variable
Description
Currently, cargo-clippy hard-codes
cargo
as the command to run and looks for it in PATH:rust-clippy/src/main.rs
Line 108 in 1c8cbe7
This means that, e.g., running
/home/jyn/.cargo/bin/cargo-clippy
directly, without having~/.cargo
in PATH, will not work.I cannot think of a use case where this would break things, but it makes me a little uncomfortable. Cargo sets the environment variable
CARGO
for subcommands: https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-cratesIt would be nice if clippy defaulted to that environment variable before falling back to the cargo in PATH.
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: