@@ -1251,11 +1251,11 @@ impl<'a> Builder<'a> {
1251
1251
self . ensure ( tool:: Rustdoc { compiler } )
1252
1252
}
1253
1253
1254
- pub fn cargo_clippy_cmd ( & self , run_compiler : Compiler ) -> Command {
1254
+ pub fn cargo_clippy_cmd ( & self , run_compiler : Compiler ) -> BootstrapCommand {
1255
1255
if run_compiler. stage == 0 {
1256
1256
// `ensure(Clippy { stage: 0 })` *builds* clippy with stage0, it doesn't use the beta clippy.
1257
1257
let cargo_clippy = self . build . config . download_clippy ( ) ;
1258
- let mut cmd = Command :: new ( cargo_clippy) ;
1258
+ let mut cmd = BootstrapCommand :: new ( cargo_clippy) ;
1259
1259
cmd. env ( "CARGO" , & self . initial_cargo ) ;
1260
1260
return cmd;
1261
1261
}
@@ -1274,13 +1274,13 @@ impl<'a> Builder<'a> {
1274
1274
let mut dylib_path = helpers:: dylib_path ( ) ;
1275
1275
dylib_path. insert ( 0 , self . sysroot ( run_compiler) . join ( "lib" ) ) ;
1276
1276
1277
- let mut cmd = Command :: new ( cargo_clippy) ;
1277
+ let mut cmd = BootstrapCommand :: new ( cargo_clippy) ;
1278
1278
cmd. env ( helpers:: dylib_path_var ( ) , env:: join_paths ( & dylib_path) . unwrap ( ) ) ;
1279
1279
cmd. env ( "CARGO" , & self . initial_cargo ) ;
1280
1280
cmd
1281
1281
}
1282
1282
1283
- pub fn cargo_miri_cmd ( & self , run_compiler : Compiler ) -> Command {
1283
+ pub fn cargo_miri_cmd ( & self , run_compiler : Compiler ) -> BootstrapCommand {
1284
1284
assert ! ( run_compiler. stage > 0 , "miri can not be invoked at stage 0" ) ;
1285
1285
let build_compiler = self . compiler ( run_compiler. stage - 1 , self . build . build ) ;
1286
1286
@@ -1296,7 +1296,7 @@ impl<'a> Builder<'a> {
1296
1296
extra_features : Vec :: new ( ) ,
1297
1297
} ) ;
1298
1298
// Invoke cargo-miri, make sure it can find miri and cargo.
1299
- let mut cmd = Command :: new ( cargo_miri) ;
1299
+ let mut cmd = BootstrapCommand :: new ( cargo_miri) ;
1300
1300
cmd. env ( "MIRI" , & miri) ;
1301
1301
cmd. env ( "CARGO" , & self . initial_cargo ) ;
1302
1302
// Need to add the `run_compiler` libs. Those are the libs produces *by* `build_compiler`,
@@ -1353,7 +1353,7 @@ impl<'a> Builder<'a> {
1353
1353
mode : Mode ,
1354
1354
target : TargetSelection ,
1355
1355
cmd : & str , // FIXME make this properly typed
1356
- ) -> Command {
1356
+ ) -> BootstrapCommand {
1357
1357
let mut cargo;
1358
1358
if cmd == "clippy" {
1359
1359
cargo = self . cargo_clippy_cmd ( compiler) ;
@@ -1366,7 +1366,7 @@ impl<'a> Builder<'a> {
1366
1366
cargo = self . cargo_miri_cmd ( compiler) ;
1367
1367
cargo. arg ( "miri" ) . arg ( subcmd) ;
1368
1368
} else {
1369
- cargo = Command :: new ( & self . initial_cargo ) ;
1369
+ cargo = BootstrapCommand :: new ( & self . initial_cargo ) ;
1370
1370
cargo. arg ( cmd) ;
1371
1371
}
1372
1372
@@ -2374,7 +2374,7 @@ impl HostFlags {
2374
2374
2375
2375
#[ derive( Debug ) ]
2376
2376
pub struct Cargo {
2377
- command : Command ,
2377
+ command : BootstrapCommand ,
2378
2378
compiler : Compiler ,
2379
2379
target : TargetSelection ,
2380
2380
rustflags : Rustflags ,
@@ -2599,8 +2599,8 @@ impl Cargo {
2599
2599
}
2600
2600
}
2601
2601
2602
- impl From < Cargo > for Command {
2603
- fn from ( mut cargo : Cargo ) -> Command {
2602
+ impl From < Cargo > for BootstrapCommand {
2603
+ fn from ( mut cargo : Cargo ) -> BootstrapCommand {
2604
2604
let rustflags = & cargo. rustflags . 0 ;
2605
2605
if !rustflags. is_empty ( ) {
2606
2606
cargo. command . env ( "RUSTFLAGS" , rustflags) ;
@@ -2619,13 +2619,12 @@ impl From<Cargo> for Command {
2619
2619
if !cargo. allow_features . is_empty ( ) {
2620
2620
cargo. command . env ( "RUSTC_ALLOW_FEATURES" , cargo. allow_features ) ;
2621
2621
}
2622
-
2623
2622
cargo. command
2624
2623
}
2625
2624
}
2626
2625
2627
- impl From < Cargo > for BootstrapCommand {
2628
- fn from ( cargo : Cargo ) -> BootstrapCommand {
2629
- Command :: from ( cargo) . into ( )
2626
+ impl From < Cargo > for Command {
2627
+ fn from ( cargo : Cargo ) -> Command {
2628
+ BootstrapCommand :: from ( cargo) . command
2630
2629
}
2631
2630
}
0 commit comments