Skip to content

Commit f24861a

Browse files
committed
Actually invoke Clippy in the Clippy profile
1 parent f7ea54a commit f24861a

File tree

1 file changed

+8
-2
lines changed
  • collector/src/compile/execute

1 file changed

+8
-2
lines changed

collector/src/compile/execute/mod.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ impl<'a> CargoProcess<'a> {
248248
};
249249

250250
if let Some(c) = &self.toolchain.components.clippy {
251-
cmd.env("CLIPPY", &*FAKE_CLIPPY).env("CLIPPY_REAL", c);
251+
cmd.env("CLIPPY_REAL", c);
252252
}
253253

254254
for config in &self.toolchain.components.cargo_configs {
@@ -330,11 +330,17 @@ impl<'a> CargoProcess<'a> {
330330
let mut cmd = self.base_command(self.cwd, cargo_subcommand);
331331
cmd.arg("-p").arg(self.get_pkgid(self.cwd)?);
332332
match self.profile {
333-
Profile::Check | Profile::Clippy => {
333+
Profile::Check => {
334334
cmd.arg("--profile").arg("check");
335335
}
336336
Profile::Debug => {}
337337
Profile::Doc => {}
338+
Profile::Clippy => {
339+
cmd.arg("--profile").arg("check");
340+
// For Clippy, we still invoke `cargo rustc`, but we need to override the
341+
// executed rustc to be clippy-fake.
342+
cmd.env("RUSTC", &*FAKE_CLIPPY);
343+
}
338344
Profile::Opt => {
339345
cmd.arg("--release");
340346
}

0 commit comments

Comments
 (0)