@@ -357,7 +357,7 @@ fn copy_link_tool_bin(
357
357
bin
358
358
}
359
359
360
- macro_rules! bootstrap_tool {
360
+ macro_rules! tool_bootstrap_or_std {
361
361
( $(
362
362
$name: ident, $path: expr, $tool_name: expr
363
363
$( , is_external_tool = $external: expr) *
@@ -377,10 +377,11 @@ macro_rules! bootstrap_tool {
377
377
378
378
impl <' a> Builder <' a> {
379
379
pub fn tool_exe( & self , tool: Tool ) -> PathBuf {
380
+ let stage = $( if false $( || $unstable) * { self . top_stage } else { 0 } ; ) +
380
381
match tool {
381
382
$( Tool :: $name =>
382
383
self . ensure( $name {
383
- compiler: self . compiler( 0 , self . config. build) ,
384
+ compiler: self . compiler( stage , self . config. build) ,
384
385
target: self . config. build,
385
386
} ) . tool_path,
386
387
) +
@@ -403,9 +404,9 @@ macro_rules! bootstrap_tool {
403
404
}
404
405
405
406
fn make_run( run: RunConfig <' _>) {
407
+ let stage = if false $( || $unstable) * { run. builder. top_stage } else { 0 } ;
406
408
run. builder. ensure( $name {
407
- // snapshot compiler
408
- compiler: run. builder. compiler( 0 , run. builder. config. build) ,
409
+ compiler: run. builder. compiler( stage, run. builder. config. build) ,
409
410
target: run. target,
410
411
} ) ;
411
412
}
@@ -456,7 +457,7 @@ macro_rules! bootstrap_tool {
456
457
}
457
458
}
458
459
459
- bootstrap_tool ! (
460
+ tool_bootstrap_or_std ! (
460
461
// This is marked as an external tool because it includes dependencies
461
462
// from submodules. Trying to keep the lints in sync between all the repos
462
463
// is a bit of a pain. Unfortunately it means the rustbook source itself
0 commit comments