Skip to content

Commit 709f917

Browse files
committed
Only check rustc when linting rustc_codegen_gcc
1 parent bbce854 commit 709f917

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;
@@ -296,15 +296,15 @@ impl Step for Rustc {
296296

297297
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
298298
pub struct CodegenGcc {
299-
compilers: RustcPrivateCompilers,
299+
build_compiler: Compiler,
300300
target: TargetSelection,
301301
config: LintConfig,
302302
}
303303

304304
impl CodegenGcc {
305305
fn new(builder: &Builder<'_>, target: TargetSelection, config: LintConfig) -> Self {
306306
Self {
307-
compilers: RustcPrivateCompilers::new(builder, builder.top_stage, target),
307+
build_compiler: prepare_compiler_for_check(builder, target, Mode::Codegen),
308308
target,
309309
config,
310310
}
@@ -325,7 +325,7 @@ impl Step for CodegenGcc {
325325
}
326326

327327
fn run(self, builder: &Builder<'_>) -> Self::Output {
328-
let build_compiler = self.compilers.build_compiler();
328+
let build_compiler = self.build_compiler;
329329
let target = self.target;
330330

331331
let cargo = prepare_tool_cargo(
@@ -363,10 +363,7 @@ impl Step for CodegenGcc {
363363
}
364364

365365
fn metadata(&self) -> Option<StepMetadata> {
366-
Some(
367-
StepMetadata::clippy("rustc_codegen_gcc", self.target)
368-
.built_by(self.compilers.build_compiler()),
369-
)
366+
Some(StepMetadata::clippy("rustc_codegen_gcc", self.target).built_by(self.build_compiler))
370367
}
371368
}
372369

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)