@@ -1231,11 +1231,11 @@ impl<'a> Builder<'a> {
1231
1231
self . ensure ( tool:: Rustdoc { compiler } )
1232
1232
}
1233
1233
1234
- pub fn cargo_clippy_cmd ( & self , run_compiler : Compiler ) -> Command {
1234
+ pub fn cargo_clippy_cmd ( & self , run_compiler : Compiler ) -> BootstrapCommand {
1235
1235
if run_compiler. stage == 0 {
1236
1236
// `ensure(Clippy { stage: 0 })` *builds* clippy with stage0, it doesn't use the beta clippy.
1237
1237
let cargo_clippy = self . build . config . download_clippy ( ) ;
1238
- let mut cmd = Command :: new ( cargo_clippy) ;
1238
+ let mut cmd = BootstrapCommand :: new ( cargo_clippy) ;
1239
1239
cmd. env ( "CARGO" , & self . initial_cargo ) ;
1240
1240
return cmd;
1241
1241
}
@@ -1254,13 +1254,13 @@ impl<'a> Builder<'a> {
1254
1254
let mut dylib_path = helpers:: dylib_path ( ) ;
1255
1255
dylib_path. insert ( 0 , self . sysroot ( run_compiler) . join ( "lib" ) ) ;
1256
1256
1257
- let mut cmd = Command :: new ( cargo_clippy) ;
1257
+ let mut cmd = BootstrapCommand :: new ( cargo_clippy) ;
1258
1258
cmd. env ( helpers:: dylib_path_var ( ) , env:: join_paths ( & dylib_path) . unwrap ( ) ) ;
1259
1259
cmd. env ( "CARGO" , & self . initial_cargo ) ;
1260
1260
cmd
1261
1261
}
1262
1262
1263
- pub fn cargo_miri_cmd ( & self , run_compiler : Compiler ) -> Command {
1263
+ pub fn cargo_miri_cmd ( & self , run_compiler : Compiler ) -> BootstrapCommand {
1264
1264
assert ! ( run_compiler. stage > 0 , "miri can not be invoked at stage 0" ) ;
1265
1265
let build_compiler = self . compiler ( run_compiler. stage - 1 , self . build . build ) ;
1266
1266
@@ -1276,7 +1276,7 @@ impl<'a> Builder<'a> {
1276
1276
extra_features : Vec :: new ( ) ,
1277
1277
} ) ;
1278
1278
// Invoke cargo-miri, make sure it can find miri and cargo.
1279
- let mut cmd = Command :: new ( cargo_miri) ;
1279
+ let mut cmd = BootstrapCommand :: new ( cargo_miri) ;
1280
1280
cmd. env ( "MIRI" , & miri) ;
1281
1281
cmd. env ( "CARGO" , & self . initial_cargo ) ;
1282
1282
// Need to add the `run_compiler` libs. Those are the libs produces *by* `build_compiler`,
@@ -1333,7 +1333,7 @@ impl<'a> Builder<'a> {
1333
1333
mode : Mode ,
1334
1334
target : TargetSelection ,
1335
1335
cmd : & str , // FIXME make this properly typed
1336
- ) -> Command {
1336
+ ) -> BootstrapCommand {
1337
1337
let mut cargo;
1338
1338
if cmd == "clippy" {
1339
1339
cargo = self . cargo_clippy_cmd ( compiler) ;
@@ -1346,7 +1346,7 @@ impl<'a> Builder<'a> {
1346
1346
cargo = self . cargo_miri_cmd ( compiler) ;
1347
1347
cargo. arg ( "miri" ) . arg ( subcmd) ;
1348
1348
} else {
1349
- cargo = Command :: new ( & self . initial_cargo ) ;
1349
+ cargo = BootstrapCommand :: new ( & self . initial_cargo ) ;
1350
1350
cargo. arg ( cmd) ;
1351
1351
}
1352
1352
@@ -2376,7 +2376,7 @@ impl HostFlags {
2376
2376
2377
2377
#[ derive( Debug ) ]
2378
2378
pub struct Cargo {
2379
- command : Command ,
2379
+ command : BootstrapCommand ,
2380
2380
compiler : Compiler ,
2381
2381
target : TargetSelection ,
2382
2382
rustflags : Rustflags ,
@@ -2601,8 +2601,8 @@ impl Cargo {
2601
2601
}
2602
2602
}
2603
2603
2604
- impl From < Cargo > for Command {
2605
- fn from ( mut cargo : Cargo ) -> Command {
2604
+ impl From < Cargo > for BootstrapCommand {
2605
+ fn from ( mut cargo : Cargo ) -> BootstrapCommand {
2606
2606
let rustflags = & cargo. rustflags . 0 ;
2607
2607
if !rustflags. is_empty ( ) {
2608
2608
cargo. command . env ( "RUSTFLAGS" , rustflags) ;
@@ -2621,13 +2621,12 @@ impl From<Cargo> for Command {
2621
2621
if !cargo. allow_features . is_empty ( ) {
2622
2622
cargo. command . env ( "RUSTC_ALLOW_FEATURES" , cargo. allow_features ) ;
2623
2623
}
2624
-
2625
2624
cargo. command
2626
2625
}
2627
2626
}
2628
2627
2629
- impl From < Cargo > for BootstrapCommand {
2630
- fn from ( cargo : Cargo ) -> BootstrapCommand {
2631
- Command :: from ( cargo) . into ( )
2628
+ impl From < Cargo > for Command {
2629
+ fn from ( cargo : Cargo ) -> Command {
2630
+ BootstrapCommand :: from ( cargo) . command
2632
2631
}
2633
2632
}
0 commit comments