@@ -61,6 +61,9 @@ impl Step for Std {
6161 return ;
6262 }
6363
64+ // Explicitly pass -p for all dependencies crates -- this will force cargo
65+ // to also check the tests/benches/examples for these crates, rather
66+ // than just the leaf crate.
6467 let crates = std_crates_for_run_make ( & run) ;
6568 run. builder . ensure ( Std {
6669 build_compiler : prepare_compiler_for_check ( run. builder , run. target , Mode :: Std )
@@ -83,16 +86,12 @@ impl Step for Std {
8386 Kind :: Check ,
8487 ) ;
8588
86- std_cargo ( builder, target, & mut cargo) ;
89+ std_cargo ( builder, target, & mut cargo, & self . crates ) ;
8790 if matches ! ( builder. config. cmd, Subcommand :: Fix ) {
8891 // By default, cargo tries to fix all targets. Tell it not to fix tests until we've added `test` to the sysroot.
8992 cargo. arg ( "--lib" ) ;
9093 }
9194
92- for krate in & * self . crates {
93- cargo. arg ( "-p" ) . arg ( krate) ;
94- }
95-
9695 let _guard = builder. msg (
9796 Kind :: Check ,
9897 format_args ! ( "library artifacts{}" , crate_description( & self . crates) ) ,
@@ -135,14 +134,7 @@ impl Step for Std {
135134 Kind :: Check ,
136135 ) ;
137136
138- std_cargo ( builder, target, & mut cargo) ;
139-
140- // Explicitly pass -p for all dependencies krates -- this will force cargo
141- // to also check the tests/benches/examples for these crates, rather
142- // than just the leaf crate.
143- for krate in & * self . crates {
144- cargo. arg ( "-p" ) . arg ( krate) ;
145- }
137+ std_cargo ( builder, target, & mut cargo, & self . crates ) ;
146138
147139 let stamp =
148140 build_stamp:: libstd_stamp ( builder, build_compiler, target) . with_prefix ( "check-test" ) ;
0 commit comments