Skip to content

Commit cc4ed44

Browse files
committed
Set CARGO instead of PATH for Rust Clippy
Resolves #123227
1 parent 36b6f9b commit cc4ed44

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/bootstrap/src/core/builder.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1196,11 +1196,10 @@ impl<'a> Builder<'a> {
11961196
pub fn cargo_clippy_cmd(&self, run_compiler: Compiler) -> Command {
11971197
let initial_sysroot_bin = self.initial_rustc.parent().unwrap();
11981198
// Set PATH to include the sysroot bin dir so clippy can find cargo.
1199-
// FIXME: once rust-clippy#11944 lands on beta, set `CARGO` directly instead.
12001199
let path = t!(env::join_paths(
12011200
// The sysroot comes first in PATH to avoid using rustup's cargo.
12021201
std::iter::once(PathBuf::from(initial_sysroot_bin))
1203-
.chain(env::split_paths(&t!(env::var("PATH"))))
1202+
.chain(env::split_paths(&t!(env::var("CARGO"))))
12041203
));
12051204

12061205
if run_compiler.stage == 0 {
@@ -1227,7 +1226,7 @@ impl<'a> Builder<'a> {
12271226

12281227
let mut cmd = Command::new(cargo_clippy);
12291228
cmd.env(helpers::dylib_path_var(), env::join_paths(&dylib_path).unwrap());
1230-
cmd.env("PATH", path);
1229+
cmd.env("CARGO", path);
12311230
cmd
12321231
}
12331232

0 commit comments

Comments
 (0)