move comments position in src/stage0

Signed-off-by: onur-ozkan <work@onurozkan.dev>
This commit is contained in:
onur-ozkan 2024-05-09 19:08:04 +03:00
parent aa2faefe12
commit 8c5375ad8e
2 changed files with 15 additions and 12 deletions

View File

@ -1,3 +1,10 @@
dist_server=https://static.rust-lang.org
artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds
artifacts_with_llvm_assertions_server=https://ci-artifacts.rust-lang.org/rustc-builds-alt
git_merge_commit_email=bors@rust-lang.org
git_repository=rust-lang/rust
nightly_branch=master
# The configuration above this comment is editable, and can be changed
# by forks of the repository if they have alternate values.
#
@ -6,14 +13,7 @@
#
# All changes below this comment will be overridden the next time the
# tool is executed.
dist_server=https://static.rust-lang.org
artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds
artifacts_with_llvm_assertions_server=https://ci-artifacts.rust-lang.org/rustc-builds-alt
git_merge_commit_email=bors@rust-lang.org
git_repository=rust-lang/rust
nightly_branch=master
compiler_date=2024-04-29
compiler_version=beta
rustfmt_date=2024-04-29

View File

@ -43,7 +43,7 @@ fn new(date: Option<String>) -> Result<Self, Error> {
}
fn update_stage0_file(mut self) -> Result<(), Error> {
const HEADER: &str = r#"# The configuration above this comment is editable, and can be changed
const COMMENTS: &str = r#"# The configuration above this comment is editable, and can be changed
# by forks of the repository if they have alternate values.
#
# The section below is generated by `./x.py run src/tools/bump-stage0`,
@ -53,8 +53,10 @@ fn update_stage0_file(mut self) -> Result<(), Error> {
# tool is executed.
"#;
let mut file_content = HEADER.to_owned();
let mut file_content = String::new();
// Destructure `Stage0Config` here to ensure the stage0 file is synced with any new
// fields when they are added.
let Stage0Config {
dist_server,
artifacts_server,
@ -64,7 +66,7 @@ fn update_stage0_file(mut self) -> Result<(), Error> {
nightly_branch,
} = &self.config;
file_content.push_str(&format!("\ndist_server={}", dist_server));
file_content.push_str(&format!("dist_server={}", dist_server));
file_content.push_str(&format!("\nartifacts_server={}", artifacts_server));
file_content.push_str(&format!(
"\nartifacts_with_llvm_assertions_server={}",
@ -74,7 +76,8 @@ fn update_stage0_file(mut self) -> Result<(), Error> {
file_content.push_str(&format!("\ngit_repository={}", git_repository));
file_content.push_str(&format!("\nnightly_branch={}", nightly_branch));
file_content.push_str("\n");
file_content.push_str("\n\n");
file_content.push_str(COMMENTS);
let compiler = self.detect_compiler()?;
file_content.push_str(&format!("\ncompiler_date={}", compiler.date));