@@ -55,8 +55,7 @@ pub enum DryRun {
55
55
/// filled out from the decoded forms of the structs below. For documentation
56
56
/// each field, see the corresponding fields in
57
57
/// `config.toml.example`.
58
- #[ derive( Default ) ]
59
- #[ cfg_attr( test, derive( Clone ) ) ]
58
+ #[ derive( Clone , Default ) ]
60
59
pub struct Config {
61
60
pub changelog_seen : Option < usize > ,
62
61
pub ccache : Option < String > ,
@@ -217,36 +216,41 @@ pub struct Config {
217
216
pub reuse : Option < PathBuf > ,
218
217
pub cargo_native_static : bool ,
219
218
pub configure_args : Vec < String > ,
219
+ pub out : PathBuf ,
220
+ pub rust_info : channel:: GitInfo ,
220
221
221
222
// These are either the stage0 downloaded binaries or the locally installed ones.
222
223
pub initial_cargo : PathBuf ,
223
224
pub initial_rustc : PathBuf ,
225
+
224
226
#[ cfg( not( test) ) ]
225
227
initial_rustfmt : RefCell < RustfmtState > ,
226
228
#[ cfg( test) ]
227
229
pub initial_rustfmt : RefCell < RustfmtState > ,
228
- pub out : PathBuf ,
229
- pub rust_info : channel:: GitInfo ,
230
230
}
231
231
232
- #[ derive( Default , Deserialize ) ]
233
- #[ cfg_attr( test, derive( Clone ) ) ]
232
+ #[ derive( Clone , Default , Deserialize ) ]
234
233
pub struct Stage0Metadata {
234
+ pub compiler : CompilerMetadata ,
235
235
pub config : Stage0Config ,
236
236
pub checksums_sha256 : HashMap < String , String > ,
237
237
pub rustfmt : Option < RustfmtMetadata > ,
238
238
}
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 ) ]
241
246
pub struct Stage0Config {
242
247
pub dist_server : String ,
243
248
pub artifacts_server : String ,
244
249
pub artifacts_with_llvm_assertions_server : String ,
245
250
pub git_merge_commit_email : String ,
246
251
pub nightly_branch : String ,
247
252
}
248
- #[ derive( Default , Deserialize ) ]
249
- #[ cfg_attr( test, derive( Clone ) ) ]
253
+ #[ derive( Clone , Default , Deserialize ) ]
250
254
pub struct RustfmtMetadata {
251
255
pub date : String ,
252
256
pub version : String ,
@@ -422,8 +426,7 @@ impl PartialEq<&str> for TargetSelection {
422
426
}
423
427
424
428
/// Per-target configuration stored in the global configuration structure.
425
- #[ derive( Default ) ]
426
- #[ cfg_attr( test, derive( Clone ) ) ]
429
+ #[ derive( Clone , Default ) ]
427
430
pub struct Target {
428
431
/// Some(path to llvm-config) if using an external LLVM.
429
432
pub llvm_config : Option < PathBuf > ,
@@ -979,10 +982,10 @@ impl Config {
979
982
config. out = crate :: util:: absolute ( & config. out ) ;
980
983
}
981
984
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
+ } ) ;
986
989
config. initial_cargo = build
987
990
. cargo
988
991
. map ( PathBuf :: from)
0 commit comments