@@ -21,13 +21,6 @@ pub struct Std {
21
21
///
22
22
/// [`compile::Rustc`]: crate::core::build_steps::compile::Rustc
23
23
crates : Vec < String > ,
24
- /// Override `Builder::kind` on cargo invocations.
25
- ///
26
- /// By default, `Builder::kind` is propagated as the subcommand to the cargo invocations.
27
- /// However, there are cases when this is not desirable. For example, when running `x clippy $tool_name`,
28
- /// passing `Builder::kind` to cargo invocations would run clippy on the entire compiler and library,
29
- /// which is not useful if we only want to lint a few crates with specific rules.
30
- override_build_kind : Option < Kind > ,
31
24
/// Never use this from outside calls. It is intended for internal use only within `check::Std::make_run`
32
25
/// and `check::Std::run`.
33
26
custom_stage : Option < u32 > ,
@@ -37,12 +30,7 @@ impl Std {
37
30
const CRATE_OR_DEPS : & [ & str ] = & [ "sysroot" , "coretests" , "alloctests" ] ;
38
31
39
32
pub fn new ( target : TargetSelection ) -> Self {
40
- Self { target, crates : vec ! [ ] , override_build_kind : None , custom_stage : None }
41
- }
42
-
43
- pub fn build_kind ( mut self , kind : Option < Kind > ) -> Self {
44
- self . override_build_kind = kind;
45
- self
33
+ Self { target, crates : vec ! [ ] , custom_stage : None }
46
34
}
47
35
}
48
36
@@ -68,12 +56,7 @@ impl Step for Std {
68
56
1
69
57
} ;
70
58
71
- run. builder . ensure ( Std {
72
- target : run. target ,
73
- crates,
74
- override_build_kind : None ,
75
- custom_stage : Some ( stage) ,
76
- } ) ;
59
+ run. builder . ensure ( Std { target : run. target , crates, custom_stage : Some ( stage) } ) ;
77
60
}
78
61
79
62
fn run ( self , builder : & Builder < ' _ > ) {
@@ -116,7 +99,7 @@ impl Step for Std {
116
99
Mode :: Std ,
117
100
SourceType :: InTree ,
118
101
target,
119
- self . override_build_kind . unwrap_or ( builder . kind ) ,
102
+ Kind :: Check ,
120
103
) ;
121
104
122
105
std_cargo ( builder, target, compiler. stage , & mut cargo) ;
@@ -147,9 +130,8 @@ impl Step for Std {
147
130
}
148
131
drop ( _guard) ;
149
132
150
- // don't run on std twice with x.py clippy
151
133
// don't check test dependencies if we haven't built libtest
152
- if builder . kind == Kind :: Clippy || !self . crates . iter ( ) . any ( |krate| krate == "test" ) {
134
+ if !self . crates . iter ( ) . any ( |krate| krate == "test" ) {
153
135
return ;
154
136
}
155
137
@@ -165,7 +147,7 @@ impl Step for Std {
165
147
Mode :: Std ,
166
148
SourceType :: InTree ,
167
149
target,
168
- self . override_build_kind . unwrap_or ( builder . kind ) ,
150
+ Kind :: Check ,
169
151
) ;
170
152
171
153
// If we're not in stage 0, tests and examples will fail to compile
@@ -382,14 +364,9 @@ impl Step for RustAnalyzer {
382
364
383
365
cargo. allow_features ( crate :: core:: build_steps:: tool:: RustAnalyzer :: ALLOW_FEATURES ) ;
384
366
385
- // For ./x.py clippy, don't check those targets because
386
- // linting tests and benchmarks can produce very noisy results
387
- if builder. kind != Kind :: Clippy {
388
- // can't use `--all-targets` because `--examples` doesn't work well
389
- cargo. arg ( "--bins" ) ;
390
- cargo. arg ( "--tests" ) ;
391
- cargo. arg ( "--benches" ) ;
392
- }
367
+ cargo. arg ( "--bins" ) ;
368
+ cargo. arg ( "--tests" ) ;
369
+ cargo. arg ( "--benches" ) ;
393
370
394
371
// Cargo's output path in a given stage, compiled by a particular
395
372
// compiler for the specified target.
@@ -450,11 +427,7 @@ impl Step for Compiletest {
450
427
451
428
cargo. allow_features ( COMPILETEST_ALLOW_FEATURES ) ;
452
429
453
- // For ./x.py clippy, don't run with --all-targets because
454
- // linting tests and benchmarks can produce very noisy results
455
- if builder. kind != Kind :: Clippy {
456
- cargo. arg ( "--all-targets" ) ;
457
- }
430
+ cargo. arg ( "--all-targets" ) ;
458
431
459
432
let stamp = BuildStamp :: new ( & builder. cargo_out ( compiler, mode, self . target ) )
460
433
. with_prefix ( "compiletest-check" ) ;
@@ -528,11 +501,7 @@ fn run_tool_check_step(
528
501
& [ ] ,
529
502
) ;
530
503
531
- // For ./x.py clippy, don't run with --all-targets because
532
- // linting tests and benchmarks can produce very noisy results
533
- if builder. kind != Kind :: Clippy {
534
- cargo. arg ( "--all-targets" ) ;
535
- }
504
+ cargo. arg ( "--all-targets" ) ;
536
505
537
506
let stamp = BuildStamp :: new ( & builder. cargo_out ( compiler, Mode :: ToolRustc , target) )
538
507
. with_prefix ( & format ! ( "{}-check" , step_type_name. to_lowercase( ) ) ) ;
0 commit comments