@@ -319,18 +319,20 @@ pub(crate) fn get_tool_rustc_compiler(
319319 builder : & Builder < ' _ > ,
320320 target_compiler : Compiler ,
321321) -> Compiler {
322- if builder. download_rustc ( ) && target_compiler. stage == 1 {
323- // We already have the stage 1 compiler, we don't need to cut the stage.
324- builder. compiler ( target_compiler. stage , builder. config . build )
325- } else if target_compiler. is_forced_compiler ( ) {
326- target_compiler
327- } else {
328- // Similar to `compile::Assemble`, build with the previous stage's compiler. Otherwise
329- // we'd have stageN/bin/rustc and stageN/bin/$rustc_tool be effectively different stage
330- // compilers, which isn't what we want. Rustc tools should be linked in the same way as the
331- // compiler it's paired with, so it must be built with the previous stage compiler.
332- builder. compiler ( target_compiler. stage . saturating_sub ( 1 ) , builder. config . build )
322+ if target_compiler. is_forced_compiler ( ) {
323+ return target_compiler;
324+ }
325+
326+ if builder. download_rustc ( ) && target_compiler. stage > 0 {
327+ // We already have the stage N compiler, we don't need to cut the stage.
328+ return builder. compiler ( target_compiler. stage , builder. config . build ) ;
333329 }
330+
331+ // Similar to `compile::Assemble`, build with the previous stage's compiler. Otherwise
332+ // we'd have stageN/bin/rustc and stageN/bin/$rustc_tool be effectively different stage
333+ // compilers, which isn't what we want. Rustc tools should be linked in the same way as the
334+ // compiler it's paired with, so it must be built with the previous stage compiler.
335+ builder. compiler ( target_compiler. stage . saturating_sub ( 1 ) , builder. config . build )
334336}
335337
336338/// Links a built tool binary with the given `name` from the build directory to the
0 commit comments