@@ -43,7 +43,7 @@ impl Tool {
43
43
}
44
44
45
45
fn update_stage0_file ( mut self ) -> Result < ( ) , Error > {
46
- const HEADER : & str = r#"# The configuration above this comment is editable, and can be changed
46
+ const COMMENTS : & str = r#"# The configuration above this comment is editable, and can be changed
47
47
# by forks of the repository if they have alternate values.
48
48
#
49
49
# The section below is generated by `./x.py run src/tools/bump-stage0`,
@@ -53,8 +53,10 @@ impl Tool {
53
53
# tool is executed.
54
54
"# ;
55
55
56
- let mut file_content = HEADER . to_owned ( ) ;
56
+ let mut file_content = String :: new ( ) ;
57
57
58
+ // Destructure `Stage0Config` here to ensure the stage0 file is synced with any new
59
+ // fields when they are added.
58
60
let Stage0Config {
59
61
dist_server,
60
62
artifacts_server,
@@ -64,7 +66,7 @@ impl Tool {
64
66
nightly_branch,
65
67
} = & self . config ;
66
68
67
- file_content. push_str ( & format ! ( "\n dist_server ={}" , dist_server) ) ;
69
+ file_content. push_str ( & format ! ( "dist_server ={}" , dist_server) ) ;
68
70
file_content. push_str ( & format ! ( "\n artifacts_server={}" , artifacts_server) ) ;
69
71
file_content. push_str ( & format ! (
70
72
"\n artifacts_with_llvm_assertions_server={}" ,
@@ -74,7 +76,8 @@ impl Tool {
74
76
file_content. push_str ( & format ! ( "\n git_repository={}" , git_repository) ) ;
75
77
file_content. push_str ( & format ! ( "\n nightly_branch={}" , nightly_branch) ) ;
76
78
77
- file_content. push_str ( "\n " ) ;
79
+ file_content. push_str ( "\n \n " ) ;
80
+ file_content. push_str ( COMMENTS ) ;
78
81
79
82
let compiler = self . detect_compiler ( ) ?;
80
83
file_content. push_str ( & format ! ( "\n compiler_date={}" , compiler. date) ) ;
0 commit comments