@@ -43,7 +43,7 @@ impl Tool {
4343 }
4444
4545 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
4747# by forks of the repository if they have alternate values.
4848#
4949# The section below is generated by `./x.py run src/tools/bump-stage0`,
@@ -53,8 +53,10 @@ impl Tool {
5353# tool is executed.
5454 "# ;
5555
56- let mut file_content = HEADER . to_owned ( ) ;
56+ let mut file_content = String :: new ( ) ;
5757
58+ // Destructure `Stage0Config` here to ensure the stage0 file is synced with any new
59+ // fields when they are added.
5860 let Stage0Config {
5961 dist_server,
6062 artifacts_server,
@@ -64,7 +66,7 @@ impl Tool {
6466 nightly_branch,
6567 } = & self . config ;
6668
67- file_content. push_str ( & format ! ( "\n dist_server ={}" , dist_server) ) ;
69+ file_content. push_str ( & format ! ( "dist_server ={}" , dist_server) ) ;
6870 file_content. push_str ( & format ! ( "\n artifacts_server={}" , artifacts_server) ) ;
6971 file_content. push_str ( & format ! (
7072 "\n artifacts_with_llvm_assertions_server={}" ,
@@ -74,7 +76,8 @@ impl Tool {
7476 file_content. push_str ( & format ! ( "\n git_repository={}" , git_repository) ) ;
7577 file_content. push_str ( & format ! ( "\n nightly_branch={}" , nightly_branch) ) ;
7678
77- file_content. push_str ( "\n " ) ;
79+ file_content. push_str ( "\n \n " ) ;
80+ file_content. push_str ( COMMENTS ) ;
7881
7982 let compiler = self . detect_compiler ( ) ?;
8083 file_content. push_str ( & format ! ( "\n compiler_date={}" , compiler. date) ) ;
0 commit comments