@@ -357,7 +357,7 @@ fn copy_link_tool_bin(
357357 bin
358358}
359359
360- macro_rules! bootstrap_tool {
360+ macro_rules! tool_bootstrap_or_std {
361361 ( $(
362362 $name: ident, $path: expr, $tool_name: expr
363363 $( , is_external_tool = $external: expr) *
@@ -377,10 +377,11 @@ macro_rules! bootstrap_tool {
377377
378378 impl <' a> Builder <' a> {
379379 pub fn tool_exe( & self , tool: Tool ) -> PathBuf {
380+ let stage = $( if false $( || $unstable) * { self . top_stage } else { 0 } ; ) +
380381 match tool {
381382 $( Tool :: $name =>
382383 self . ensure( $name {
383- compiler: self . compiler( 0 , self . config. build) ,
384+ compiler: self . compiler( stage , self . config. build) ,
384385 target: self . config. build,
385386 } ) . tool_path,
386387 ) +
@@ -403,9 +404,9 @@ macro_rules! bootstrap_tool {
403404 }
404405
405406 fn make_run( run: RunConfig <' _>) {
407+ let stage = if false $( || $unstable) * { run. builder. top_stage } else { 0 } ;
406408 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) ,
409410 target: run. target,
410411 } ) ;
411412 }
@@ -456,7 +457,7 @@ macro_rules! bootstrap_tool {
456457 }
457458}
458459
459- bootstrap_tool ! (
460+ tool_bootstrap_or_std ! (
460461 // This is marked as an external tool because it includes dependencies
461462 // from submodules. Trying to keep the lints in sync between all the repos
462463 // is a bit of a pain. Unfortunately it means the rustbook source itself
0 commit comments