Skip to content

Commit

Permalink
move comments position in src/stage0
Browse files Browse the repository at this point in the history
Signed-off-by: onur-ozkan <[email protected]>
  • Loading branch information
onur-ozkan committed May 11, 2024
1 parent aa2faef commit 8c5375a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
16 changes: 8 additions & 8 deletions src/stage0
Original file line number Diff line number Diff line change
@@ -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
[email protected]
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.
#
Expand All @@ -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
[email protected]
git_repository=rust-lang/rust
nightly_branch=master


compiler_date=2024-04-29
compiler_version=beta
rustfmt_date=2024-04-29
Expand Down
11 changes: 7 additions & 4 deletions src/tools/bump-stage0/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl Tool {
}

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`,
Expand All @@ -53,8 +53,10 @@ impl Tool {
# 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,
Expand All @@ -64,7 +66,7 @@ impl Tool {
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={}",
Expand All @@ -74,7 +76,8 @@ impl Tool {
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));
Expand Down

0 comments on commit 8c5375a

Please sign in to comment.