@@ -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 : & [ ] ,
@@ -120,7 +121,7 @@ impl Step for Std {
120121 trace ! ( force_recompile) ;
121122
122123 run. builder . ensure ( Std {
123- compiler : run. builder . compiler ( run. builder . top_stage , run. build_triple ( ) ) ,
124+ build_compiler : run. builder . compiler ( run. builder . top_stage , run. build_triple ( ) ) ,
124125 target : run. target ,
125126 crates,
126127 force_recompile,
@@ -138,8 +139,8 @@ impl Step for Std {
138139 let target = self . target ;
139140
140141 // We already have std ready to be used for stage 0.
141- if self . compiler . stage == 0 {
142- let compiler = self . compiler ;
142+ if self . build_compiler . stage == 0 {
143+ let compiler = self . build_compiler ;
143144 builder. ensure ( StdLink :: from_std ( self , compiler) ) ;
144145
145146 return ;
@@ -148,9 +149,10 @@ impl Step for Std {
148149 let build_compiler = if builder. download_rustc ( ) && self . force_recompile {
149150 // When there are changes in the library tree with CI-rustc, we want to build
150151 // the stageN library and that requires using stageN-1 compiler.
151- builder. compiler ( self . compiler . stage . saturating_sub ( 1 ) , builder. config . host_target )
152+ builder
153+ . compiler ( self . build_compiler . stage . saturating_sub ( 1 ) , builder. config . host_target )
152154 } else {
153- self . compiler
155+ self . build_compiler
154156 } ;
155157
156158 // When using `download-rustc`, we already have artifacts for the host available. Don't
@@ -299,7 +301,7 @@ impl Step for Std {
299301 }
300302
301303 fn metadata ( & self ) -> Option < StepMetadata > {
302- Some ( StepMetadata :: build ( "std" , self . target ) . built_by ( self . compiler ) )
304+ Some ( StepMetadata :: build ( "std" , self . target ) . built_by ( self . build_compiler ) )
303305 }
304306}
305307
@@ -680,7 +682,7 @@ impl StdLink {
680682 pub fn from_std ( std : Std , host_compiler : Compiler ) -> Self {
681683 Self {
682684 compiler : host_compiler,
683- target_compiler : std. compiler ,
685+ target_compiler : std. build_compiler ,
684686 target : std. target ,
685687 crates : std. crates ,
686688 force_recompile : std. force_recompile ,
0 commit comments