#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct Clippy {
+ stage: u32,
host: Interned<String>,
}
fn make_run(run: RunConfig) {
run.builder.ensure(Clippy {
+ stage: run.builder.top_stage,
host: run.target,
});
}
/// Runs `cargo test` for clippy.
fn run(self, builder: &Builder) {
let build = builder.build;
+ let stage = self.stage;
let host = self.host;
- let compiler = builder.compiler(1, host);
+ let compiler = builder.compiler(stage, host);
- let _clippy = builder.ensure(tool::Clippy { compiler, target: self.host });
+ let clippy = builder.ensure(tool::Clippy { compiler, target: self.host });
let mut cargo = builder.cargo(compiler, Mode::Tool, host, "test");
cargo.arg("--manifest-path").arg(build.src.join("src/tools/clippy/Cargo.toml"));
cargo.env("RUSTC_NO_PREFER_DYNAMIC", "1");
// clippy tests need to know about the stage sysroot
cargo.env("SYSROOT", builder.sysroot(compiler));
+ // clippy tests need to find the driver
+ cargo.env("CLIPPY_DRIVER_PATH", clippy);
builder.add_rustc_lib_path(compiler, &mut cargo);
impl Step for Clippy {
type Output = PathBuf;
- const DEFAULT: bool = false;
+ const DEFAULT: bool = true;
const ONLY_HOSTS: bool = true;
fn should_run(run: ShouldRun) -> ShouldRun {
builder.ensure(ToolBuild {
compiler: self.compiler,
target: self.target,
- tool: "clippy",
+ tool: "clippy-driver",
mode: Mode::Librustc,
path: "src/tools/clippy",
expectation: builder.build.config.toolstate.clippy.passes(ToolState::Compiling),