@@ -199,13 +199,6 @@ pub struct Rustc {
199
199
///
200
200
/// [`compile::Rustc`]: crate::core::build_steps::compile::Rustc
201
201
crates : Vec < String > ,
202
- /// Override `Builder::kind` on cargo invocations.
203
- ///
204
- /// By default, `Builder::kind` is propagated as the subcommand to the cargo invocations.
205
- /// However, there are cases when this is not desirable. For example, when running `x clippy $tool_name`,
206
- /// passing `Builder::kind` to cargo invocations would run clippy on the entire compiler and library,
207
- /// which is not useful if we only want to lint a few crates with specific rules.
208
- override_build_kind : Option < Kind > ,
209
202
}
210
203
211
204
impl Rustc {
@@ -215,12 +208,7 @@ impl Rustc {
215
208
. into_iter ( )
216
209
. map ( |krate| krate. name . to_string ( ) )
217
210
. collect ( ) ;
218
- Self { target, crates, override_build_kind : None }
219
- }
220
-
221
- pub fn build_kind ( mut self , build_kind : Option < Kind > ) -> Self {
222
- self . override_build_kind = build_kind;
223
- self
211
+ Self { target, crates }
224
212
}
225
213
}
226
214
@@ -235,7 +223,7 @@ impl Step for Rustc {
235
223
236
224
fn make_run ( run : RunConfig < ' _ > ) {
237
225
let crates = run. make_run_crates ( Alias :: Compiler ) ;
238
- run. builder . ensure ( Rustc { target : run. target , crates, override_build_kind : None } ) ;
226
+ run. builder . ensure ( Rustc { target : run. target , crates } ) ;
239
227
}
240
228
241
229
/// Builds the compiler.
@@ -256,7 +244,7 @@ impl Step for Rustc {
256
244
builder. ensure ( crate :: core:: build_steps:: compile:: Std :: new ( compiler, compiler. host ) ) ;
257
245
builder. ensure ( crate :: core:: build_steps:: compile:: Std :: new ( compiler, target) ) ;
258
246
} else {
259
- builder. ensure ( Std :: new ( target) . build_kind ( self . override_build_kind ) ) ;
247
+ builder. ensure ( Std :: new ( target) ) ;
260
248
}
261
249
262
250
let mut cargo = builder:: Cargo :: new (
@@ -265,17 +253,11 @@ impl Step for Rustc {
265
253
Mode :: Rustc ,
266
254
SourceType :: InTree ,
267
255
target,
268
- self . override_build_kind . unwrap_or ( builder . kind ) ,
256
+ Kind :: Check ,
269
257
) ;
270
258
271
259
rustc_cargo ( builder, & mut cargo, target, & compiler, & self . crates ) ;
272
260
273
- // For ./x.py clippy, don't run with --all-targets because
274
- // linting tests and benchmarks can produce very noisy results
275
- if builder. kind != Kind :: Clippy {
276
- cargo. arg ( "--all-targets" ) ;
277
- }
278
-
279
261
// Explicitly pass -p for all compiler crates -- this will force cargo
280
262
// to also check the tests/benches/examples for these crates, rather
281
263
// than just the leaf crate.
0 commit comments