@@ -55,8 +55,7 @@ pub enum DryRun {
5555/// filled out from the decoded forms of the structs below. For documentation
5656/// each field, see the corresponding fields in
5757/// `config.toml.example`.
58- #[ derive( Default ) ]
59- #[ cfg_attr( test, derive( Clone ) ) ]
58+ #[ derive( Clone , Default ) ]
6059pub struct Config {
6160 pub changelog_seen : Option < usize > ,
6261 pub ccache : Option < String > ,
@@ -217,36 +216,41 @@ pub struct Config {
217216 pub reuse : Option < PathBuf > ,
218217 pub cargo_native_static : bool ,
219218 pub configure_args : Vec < String > ,
219+ pub out : PathBuf ,
220+ pub rust_info : channel:: GitInfo ,
220221
221222 // These are either the stage0 downloaded binaries or the locally installed ones.
222223 pub initial_cargo : PathBuf ,
223224 pub initial_rustc : PathBuf ,
225+
224226 #[ cfg( not( test) ) ]
225227 initial_rustfmt : RefCell < RustfmtState > ,
226228 #[ cfg( test) ]
227229 pub initial_rustfmt : RefCell < RustfmtState > ,
228- pub out : PathBuf ,
229- pub rust_info : channel:: GitInfo ,
230230}
231231
232- #[ derive( Default , Deserialize ) ]
233- #[ cfg_attr( test, derive( Clone ) ) ]
232+ #[ derive( Clone , Default , Deserialize ) ]
234233pub struct Stage0Metadata {
234+ pub compiler : CompilerMetadata ,
235235 pub config : Stage0Config ,
236236 pub checksums_sha256 : HashMap < String , String > ,
237237 pub rustfmt : Option < RustfmtMetadata > ,
238238}
239- #[ derive( Default , Deserialize ) ]
240- #[ cfg_attr( test, derive( Clone ) ) ]
239+ #[ derive( Clone , Default , Deserialize ) ]
240+ pub struct CompilerMetadata {
241+ pub date : String ,
242+ pub version : String ,
243+ }
244+
245+ #[ derive( Clone , Default , Deserialize ) ]
241246pub struct Stage0Config {
242247 pub dist_server : String ,
243248 pub artifacts_server : String ,
244249 pub artifacts_with_llvm_assertions_server : String ,
245250 pub git_merge_commit_email : String ,
246251 pub nightly_branch : String ,
247252}
248- #[ derive( Default , Deserialize ) ]
249- #[ cfg_attr( test, derive( Clone ) ) ]
253+ #[ derive( Clone , Default , Deserialize ) ]
250254pub struct RustfmtMetadata {
251255 pub date : String ,
252256 pub version : String ,
@@ -422,8 +426,7 @@ impl PartialEq<&str> for TargetSelection {
422426}
423427
424428/// Per-target configuration stored in the global configuration structure.
425- #[ derive( Default ) ]
426- #[ cfg_attr( test, derive( Clone ) ) ]
429+ #[ derive( Clone , Default ) ]
427430pub struct Target {
428431 /// Some(path to llvm-config) if using an external LLVM.
429432 pub llvm_config : Option < PathBuf > ,
@@ -979,10 +982,10 @@ impl Config {
979982 config. out = crate :: util:: absolute ( & config. out ) ;
980983 }
981984
982- config. initial_rustc = build
983- . rustc
984- . map ( PathBuf :: from )
985- . unwrap_or_else ( || config . out . join ( config . build . triple ) . join ( "stage0/bin/rustc" ) ) ;
985+ config. initial_rustc = build. rustc . map ( PathBuf :: from ) . unwrap_or_else ( || {
986+ config . download_beta_toolchain ( ) ;
987+ config . out . join ( config . build . triple ) . join ( "stage0/bin/rustc" )
988+ } ) ;
986989 config. initial_cargo = build
987990 . cargo
988991 . map ( PathBuf :: from)
0 commit comments