@@ -107,6 +107,11 @@ impl Step for Std {
107
107
add_to_sysroot(&builder, &libdir, &hostdir, &libstd_stamp(builder, compiler, target));
108
108
}
109
109
110
+ // don't run on std twice with x.py clippy
111
+ if builder.kind == Kind::Clippy {
112
+ return;
113
+ }
114
+
110
115
// Then run cargo again, once we've put the rmeta files for the library
111
116
// crates into the sysroot. This is needed because e.g., core's tests
112
117
// depend on `libtest` -- Cargo presumes it will exist, but it doesn't
@@ -120,6 +125,7 @@ impl Step for Std {
120
125
target,
121
126
cargo_subcommand(builder.kind),
122
127
);
128
+
123
129
cargo.arg("--all-targets");
124
130
std_cargo(builder, target, compiler.stage, &mut cargo);
125
131
@@ -192,7 +198,12 @@ impl Step for Rustc {
192
198
cargo_subcommand(builder.kind),
193
199
);
194
200
rustc_cargo(builder, &mut cargo, target);
195
- cargo.arg("--all-targets");
201
+
202
+ // For ./x.py clippy, don't run with --all-targets because
203
+ // linting tests and benchmarks can produce very noisy results
204
+ if builder.kind != Kind::Clippy {
205
+ cargo.arg("--all-targets");
206
+ }
196
207
197
208
// Explicitly pass -p for all compiler krates -- this will force cargo
198
209
// to also check the tests/benches/examples for these crates, rather
@@ -313,7 +324,12 @@ macro_rules! tool_check_step {
313
324
$source_type,
314
325
&[],
315
326
);
316
- cargo.arg("--all-targets");
327
+
328
+ // For ./x.py clippy, don't run with --all-targets because
329
+ // linting tests and benchmarks can produce very noisy results
330
+ if builder.kind != Kind::Clippy {
331
+ cargo.arg("--all-targets");
332
+ }
317
333
318
334
// Enable internal lints for clippy and rustdoc
319
335
// NOTE: this doesn't enable lints for any other tools unless they explicitly add `#![warn(rustc::internal)]`
0 commit comments