@@ -115,7 +115,7 @@ impl Step for ToolBuild {
115
115
116
116
let target_compiler = self . build_compiler ;
117
117
self . build_compiler = if self . mode == Mode :: ToolRustc {
118
- get_tool_rustc_compiler ( builder, self . build_compiler )
118
+ get_tool_rustc_build_compiler ( builder, self . build_compiler )
119
119
} else {
120
120
self . build_compiler
121
121
} ;
@@ -347,7 +347,7 @@ pub fn prepare_tool_cargo(
347
347
}
348
348
349
349
/// Handle stage-off logic for `ToolRustc` tools when necessary.
350
- pub ( crate ) fn get_tool_rustc_compiler (
350
+ pub ( crate ) fn get_tool_rustc_build_compiler (
351
351
builder : & Builder < ' _ > ,
352
352
target_compiler : Compiler ,
353
353
) -> Compiler {
@@ -1302,7 +1302,9 @@ impl Step for LibcxxVersionTool {
1302
1302
}
1303
1303
}
1304
1304
1305
- macro_rules! tool_extended {
1305
+ /// Creates a step that builds an extended `Mode::ToolRustc` tool
1306
+ /// and installs it into the sysroot of a corresponding compiler.
1307
+ macro_rules! tool_rustc_extended {
1306
1308
(
1307
1309
$name: ident {
1308
1310
path: $path: expr,
@@ -1326,7 +1328,7 @@ macro_rules! tool_extended {
1326
1328
const ONLY_HOSTS : bool = true ;
1327
1329
1328
1330
fn should_run( run: ShouldRun <' _>) -> ShouldRun <' _> {
1329
- should_run_tool_build_step (
1331
+ should_run_extended_rustc_tool (
1330
1332
run,
1331
1333
$tool_name,
1332
1334
$path,
@@ -1343,7 +1345,7 @@ macro_rules! tool_extended {
1343
1345
1344
1346
fn run( self , builder: & Builder <' _>) -> ToolBuildResult {
1345
1347
let Self { compiler, target } = self ;
1346
- run_tool_build_step (
1348
+ build_extended_rustc_tool (
1347
1349
builder,
1348
1350
compiler,
1349
1351
target,
@@ -1367,7 +1369,7 @@ macro_rules! tool_extended {
1367
1369
}
1368
1370
}
1369
1371
1370
- fn should_run_tool_build_step < ' a > (
1372
+ fn should_run_extended_rustc_tool < ' a > (
1371
1373
run : ShouldRun < ' a > ,
1372
1374
tool_name : & ' static str ,
1373
1375
path : & ' static str ,
@@ -1392,7 +1394,7 @@ fn should_run_tool_build_step<'a>(
1392
1394
}
1393
1395
1394
1396
#[ expect( clippy:: too_many_arguments) ] // silence overeager clippy lint
1395
- fn run_tool_build_step (
1397
+ fn build_extended_rustc_tool (
1396
1398
builder : & Builder < ' _ > ,
1397
1399
compiler : Compiler ,
1398
1400
target : TargetSelection ,
@@ -1441,19 +1443,19 @@ fn run_tool_build_step(
1441
1443
}
1442
1444
}
1443
1445
1444
- tool_extended ! ( Cargofmt {
1446
+ tool_rustc_extended ! ( Cargofmt {
1445
1447
path: "src/tools/rustfmt" ,
1446
1448
tool_name: "cargo-fmt" ,
1447
1449
stable: true ,
1448
1450
add_bins_to_sysroot: [ "cargo-fmt" ]
1449
1451
} ) ;
1450
- tool_extended ! ( CargoClippy {
1452
+ tool_rustc_extended ! ( CargoClippy {
1451
1453
path: "src/tools/clippy" ,
1452
1454
tool_name: "cargo-clippy" ,
1453
1455
stable: true ,
1454
1456
add_bins_to_sysroot: [ "cargo-clippy" ]
1455
1457
} ) ;
1456
- tool_extended ! ( Clippy {
1458
+ tool_rustc_extended ! ( Clippy {
1457
1459
path: "src/tools/clippy" ,
1458
1460
tool_name: "clippy-driver" ,
1459
1461
stable: true ,
@@ -1464,21 +1466,21 @@ tool_extended!(Clippy {
1464
1466
}
1465
1467
}
1466
1468
} ) ;
1467
- tool_extended ! ( Miri {
1469
+ tool_rustc_extended ! ( Miri {
1468
1470
path: "src/tools/miri" ,
1469
1471
tool_name: "miri" ,
1470
1472
stable: false ,
1471
1473
add_bins_to_sysroot: [ "miri" ] ,
1472
1474
// Always compile also tests when building miri. Otherwise feature unification can cause rebuilds between building and testing miri.
1473
1475
cargo_args: & [ "--all-targets" ] ,
1474
1476
} ) ;
1475
- tool_extended ! ( CargoMiri {
1477
+ tool_rustc_extended ! ( CargoMiri {
1476
1478
path: "src/tools/miri/cargo-miri" ,
1477
1479
tool_name: "cargo-miri" ,
1478
1480
stable: false ,
1479
1481
add_bins_to_sysroot: [ "cargo-miri" ]
1480
1482
} ) ;
1481
- tool_extended ! ( Rustfmt {
1483
+ tool_rustc_extended ! ( Rustfmt {
1482
1484
path: "src/tools/rustfmt" ,
1483
1485
tool_name: "rustfmt" ,
1484
1486
stable: true ,
0 commit comments