@@ -37,11 +37,12 @@ use crate::{
3737 debug, trace,
3838} ;
3939
40- /// Build a standard library for the given `target` using the given `compiler `.
40+ /// Build a standard library for the given `target` using the given `build_compiler `.
4141#[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
4242pub struct Std {
4343 pub target : TargetSelection ,
44- pub compiler : Compiler ,
44+ /// Compiler that builds the standard library.
45+ pub build_compiler : Compiler ,
4546 /// Whether to build only a subset of crates in the standard library.
4647 ///
4748 /// This shouldn't be used from other steps; see the comment on [`Rustc`].
@@ -54,10 +55,10 @@ pub struct Std {
5455}
5556
5657impl Std {
57- pub fn new ( compiler : Compiler , target : TargetSelection ) -> Self {
58+ pub fn new ( build_compiler : Compiler , target : TargetSelection ) -> Self {
5859 Self {
5960 target,
60- compiler ,
61+ build_compiler ,
6162 crates : Default :: default ( ) ,
6263 force_recompile : false ,
6364 extra_rust_args : & [ ] ,
@@ -121,7 +122,7 @@ impl Step for Std {
121122 trace ! ( force_recompile) ;
122123
123124 run. builder . ensure ( Std {
124- compiler : run. builder . compiler ( run. builder . top_stage , run. build_triple ( ) ) ,
125+ build_compiler : run. builder . compiler ( run. builder . top_stage , run. build_triple ( ) ) ,
125126 target : run. target ,
126127 crates,
127128 force_recompile,
@@ -152,8 +153,8 @@ impl Step for Std {
152153 let target = self . target ;
153154
154155 // We already have std ready to be used for stage 0.
155- if self . compiler . stage == 0 {
156- let compiler = self . compiler ;
156+ if self . build_compiler . stage == 0 {
157+ let compiler = self . build_compiler ;
157158 builder. ensure ( StdLink :: from_std ( self , compiler) ) ;
158159
159160 return ;
@@ -162,9 +163,10 @@ impl Step for Std {
162163 let build_compiler = if builder. download_rustc ( ) && self . force_recompile {
163164 // When there are changes in the library tree with CI-rustc, we want to build
164165 // the stageN library and that requires using stageN-1 compiler.
165- builder. compiler ( self . compiler . stage . saturating_sub ( 1 ) , builder. config . host_target )
166+ builder
167+ . compiler ( self . build_compiler . stage . saturating_sub ( 1 ) , builder. config . host_target )
166168 } else {
167- self . compiler
169+ self . build_compiler
168170 } ;
169171
170172 // When using `download-rustc`, we already have artifacts for the host available. Don't
@@ -313,7 +315,7 @@ impl Step for Std {
313315 }
314316
315317 fn metadata ( & self ) -> Option < StepMetadata > {
316- Some ( StepMetadata :: build ( "std" , self . target ) . built_by ( self . compiler ) )
318+ Some ( StepMetadata :: build ( "std" , self . target ) . built_by ( self . build_compiler ) )
317319 }
318320}
319321
@@ -694,7 +696,7 @@ impl StdLink {
694696 pub fn from_std ( std : Std , host_compiler : Compiler ) -> Self {
695697 Self {
696698 compiler : host_compiler,
697- target_compiler : std. compiler ,
699+ target_compiler : std. build_compiler ,
698700 target : std. target ,
699701 crates : std. crates ,
700702 force_recompile : std. force_recompile ,
0 commit comments