Rollup merge of #72674 - Mark-Simulacrum:clippy-always-test-pass, r=oli-obk
Clippy should always build This just unwraps clippy's build step instead of skipping tests if clippy didn't build. This matches e.g. cargo's behavior and seems more correct, as we always expect clippy to successfully build. I believe this doesn't actually change anything in practice, but I feel mildly uncomfortable potentially leaving this hole open.
This commit is contained in:
commit
feaceb2063
@ -516,12 +516,9 @@ impl Step for Clippy {
|
||||
let host = self.host;
|
||||
let compiler = builder.compiler(stage, host);
|
||||
|
||||
let clippy = builder.ensure(tool::Clippy {
|
||||
compiler,
|
||||
target: self.host,
|
||||
extra_features: Vec::new(),
|
||||
});
|
||||
if let Some(clippy) = clippy {
|
||||
let clippy = builder
|
||||
.ensure(tool::Clippy { compiler, target: self.host, extra_features: Vec::new() })
|
||||
.expect("in-tree tool");
|
||||
let mut cargo = tool::prepare_tool_cargo(
|
||||
builder,
|
||||
compiler,
|
||||
@ -538,10 +535,8 @@ impl Step for Clippy {
|
||||
cargo.env("RUSTC_TEST_SUITE", builder.rustc(compiler));
|
||||
cargo.env("RUSTC_LIB_PATH", builder.rustc_libdir(compiler));
|
||||
let host_libs = builder.stage_out(compiler, Mode::ToolRustc).join(builder.cargo_dir());
|
||||
let target_libs = builder
|
||||
.stage_out(compiler, Mode::ToolRustc)
|
||||
.join(&self.host)
|
||||
.join(builder.cargo_dir());
|
||||
let target_libs =
|
||||
builder.stage_out(compiler, Mode::ToolRustc).join(&self.host).join(builder.cargo_dir());
|
||||
cargo.env("HOST_LIBS", host_libs);
|
||||
cargo.env("TARGET_LIBS", target_libs);
|
||||
// clippy tests need to find the driver
|
||||
@ -552,9 +547,6 @@ impl Step for Clippy {
|
||||
builder.add_rustc_lib_path(compiler, &mut cargo);
|
||||
|
||||
try_run(builder, &mut cargo.into());
|
||||
} else {
|
||||
eprintln!("failed to test clippy: could not build");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user