Skip to content

Commit 230dc5f

Browse files
committed
move comments position in src/stage0
Signed-off-by: onur-ozkan <work@onurozkan.dev>
1 parent 0cf3060 commit 230dc5f

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

src/stage0

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
dist_server=https://static.rust-lang.org
2+
artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds
3+
artifacts_with_llvm_assertions_server=https://ci-artifacts.rust-lang.org/rustc-builds-alt
4+
git_merge_commit_email=bors@rust-lang.org
5+
git_repository=rust-lang/rust
6+
nightly_branch=master
7+
18
# The configuration above this comment is editable, and can be changed
29
# by forks of the repository if they have alternate values.
310
#
@@ -6,14 +13,7 @@
613
#
714
# All changes below this comment will be overridden the next time the
815
# tool is executed.
9-
10-
dist_server=https://static.rust-lang.org
11-
artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds
12-
artifacts_with_llvm_assertions_server=https://ci-artifacts.rust-lang.org/rustc-builds-alt
13-
git_merge_commit_email=bors@rust-lang.org
14-
git_repository=rust-lang/rust
15-
nightly_branch=master
16-
16+
1717
compiler_date=2024-04-29
1818
compiler_version=beta
1919
rustfmt_date=2024-04-29

src/tools/bump-stage0/src/main.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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,7 +53,7 @@ impl Tool {
5353
# tool is executed.
5454
"#;
5555

56-
let mut file_content = HEADER.to_owned();
56+
let mut file_content = String::new();
5757

5858
let Stage0Config {
5959
dist_server,
@@ -64,7 +64,7 @@ impl Tool {
6464
nightly_branch,
6565
} = &self.config;
6666

67-
file_content.push_str(&format!("\ndist_server={}", dist_server));
67+
file_content.push_str(&format!("dist_server={}", dist_server));
6868
file_content.push_str(&format!("\nartifacts_server={}", artifacts_server));
6969
file_content.push_str(&format!(
7070
"\nartifacts_with_llvm_assertions_server={}",
@@ -74,7 +74,8 @@ impl Tool {
7474
file_content.push_str(&format!("\ngit_repository={}", git_repository));
7575
file_content.push_str(&format!("\nnightly_branch={}", nightly_branch));
7676

77-
file_content.push_str("\n");
77+
file_content.push_str("\n\n");
78+
file_content.push_str(COMMENTS);
7879

7980
let compiler = self.detect_compiler()?;
8081
file_content.push_str(&format!("\ncompiler_date={}", compiler.date));

0 commit comments

Comments
 (0)