Skip to content

Commit 5ee02e5

Browse files
authored
Rollup merge of rust-lang#149458 - GuillaumeGomez:clippy-cg_gcc, r=kobzol
Run clippy on cg_gcc in CI This is to prevent [this issue](rust-lang#149449 (comment)): in cg_gcc repository, we run clippy on our code but not in here, which can create issues. cc ```@antoyo``` r? ```@Kobzol```
2 parents 93c44b4 + 06500aa commit 5ee02e5

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

compiler/rustc_codegen_gcc/src/builder.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,11 +500,11 @@ impl<'gcc, 'tcx> BackendTypes for Builder<'_, 'gcc, 'tcx> {
500500
}
501501

502502
fn set_rvalue_location<'a, 'gcc, 'tcx>(
503-
bx: &mut Builder<'a, 'gcc, 'tcx>,
503+
_bx: &mut Builder<'a, 'gcc, 'tcx>,
504504
rvalue: RValue<'gcc>,
505505
) -> RValue<'gcc> {
506-
if let Some(location) = bx.location {
507-
#[cfg(feature = "master")]
506+
#[cfg(feature = "master")]
507+
if let Some(location) = _bx.location {
508508
rvalue.set_location(location);
509509
}
510510
rvalue

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

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -379,15 +379,24 @@ impl Step for CodegenGcc {
379379
let stamp = BuildStamp::new(&builder.cargo_out(build_compiler, Mode::Codegen, target))
380380
.with_prefix("rustc_codegen_gcc-check");
381381

382-
run_cargo(
382+
let args = lint_args(builder, &self.config, &[]);
383+
run_cargo(builder, cargo, args.clone(), &stamp, vec![], true, false);
384+
385+
// Same but we disable the features enabled by default.
386+
let mut cargo = prepare_tool_cargo(
383387
builder,
384-
cargo,
385-
lint_args(builder, &self.config, &[]),
386-
&stamp,
387-
vec![],
388-
true,
389-
false,
388+
build_compiler,
389+
Mode::Codegen,
390+
target,
391+
Kind::Clippy,
392+
"compiler/rustc_codegen_gcc",
393+
SourceType::InTree,
394+
&[],
390395
);
396+
self.build_compiler.configure_cargo(&mut cargo);
397+
println!("Now running clippy on `rustc_codegen_gcc` with `--no-default-features`");
398+
cargo.arg("--no-default-features");
399+
run_cargo(builder, cargo, args, &stamp, vec![], true, false);
391400
}
392401

393402
fn metadata(&self) -> Option<StepMetadata> {

0 commit comments

Comments
 (0)