Skip to content

Commit 92e1541

Browse files
committed
Only check rustc when linting rustc_codegen_gcc
1 parent 75c5c36 commit 92e1541

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/bootstrap/src/core/build_steps/clippy.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//! (as usual) a massive undertaking/refactoring.
1414
1515
use super::compile::{run_cargo, rustc_cargo, std_cargo};
16-
use super::tool::{RustcPrivateCompilers, SourceType, prepare_tool_cargo};
16+
use super::tool::{SourceType, prepare_tool_cargo};
1717
use crate::builder::{Builder, ShouldRun};
1818
use crate::core::build_steps::check::prepare_compiler_for_check;
1919
use crate::core::build_steps::compile::std_crates_for_run_make;
@@ -306,15 +306,15 @@ impl Step for Rustc {
306306

307307
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
308308
pub struct CodegenGcc {
309-
compilers: RustcPrivateCompilers,
309+
build_compiler: Compiler,
310310
target: TargetSelection,
311311
config: LintConfig,
312312
}
313313

314314
impl CodegenGcc {
315315
fn new(builder: &Builder<'_>, target: TargetSelection, config: LintConfig) -> Self {
316316
Self {
317-
compilers: RustcPrivateCompilers::new(builder, builder.top_stage, target),
317+
build_compiler: prepare_compiler_for_check(builder, target, Mode::Codegen),
318318
target,
319319
config,
320320
}
@@ -335,7 +335,7 @@ impl Step for CodegenGcc {
335335
}
336336

337337
fn run(self, builder: &Builder<'_>) -> Self::Output {
338-
let build_compiler = self.compilers.build_compiler();
338+
let build_compiler = self.build_compiler;
339339
let target = self.target;
340340

341341
let cargo = prepare_tool_cargo(
@@ -367,10 +367,7 @@ impl Step for CodegenGcc {
367367
}
368368

369369
fn metadata(&self) -> Option<StepMetadata> {
370-
Some(
371-
StepMetadata::clippy("rustc_codegen_gcc", self.target)
372-
.built_by(self.compilers.build_compiler()),
373-
)
370+
Some(StepMetadata::clippy("rustc_codegen_gcc", self.target).built_by(self.build_compiler))
374371
}
375372
}
376373

src/bootstrap/src/core/builder/tests.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2080,6 +2080,7 @@ mod snapshot {
20802080
[build] rustc 0 <host> -> cargo-clippy 1 <host>
20812081
[clippy] rustc 1 <host> -> std 1 <host>
20822082
[clippy] rustc 0 <host> -> rustc 1 <host>
2083+
[check] rustc 0 <host> -> rustc 1 <host>
20832084
[clippy] rustc 0 <host> -> rustc_codegen_gcc 1 <host>
20842085
");
20852086
}
@@ -2103,6 +2104,7 @@ mod snapshot {
21032104
[build] rustc 1 <host> -> cargo-clippy 2 <host>
21042105
[clippy] rustc 2 <host> -> std 2 <host>
21052106
[clippy] rustc 1 <host> -> rustc 2 <host>
2107+
[check] rustc 1 <host> -> rustc 2 <host>
21062108
[clippy] rustc 1 <host> -> rustc_codegen_gcc 2 <host>
21072109
");
21082110
}

0 commit comments

Comments
 (0)