Skip to content

Commit 5d715d7

Browse files
committed
Fix spacing when testing individual crates
1 parent 2616a6e commit 5d715d7

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

src/bootstrap/src/core/builder/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ pub fn crate_description(crates: &[impl AsRef<str>]) -> String {
291291
return "".into();
292292
}
293293

294-
let mut descr = String::from(" {");
294+
let mut descr = String::from("{");
295295
descr.push_str(crates[0].as_ref());
296296
for krate in &crates[1..] {
297297
descr.push_str(", ");

src/bootstrap/src/core/builder/tests.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1878,9 +1878,10 @@ mod snapshot {
18781878
[test] CoverageRunRustdoc <host>
18791879
[test] Pretty <host>
18801880
[build] rustc 1 <host> -> std 1 <host>
1881+
[build] rustc 0 <host> -> std 0 <host>
1882+
[build] rustdoc 0 <host>
18811883
[test] CrateLibrustc <host>
18821884
[build] rustc 1 <host> -> rustc 2 <host>
1883-
[build] rustdoc 0 <host>
18841885
[test] crate-bootstrap <host> src/tools/coverage-dump
18851886
[test] crate-bootstrap <host> src/tools/jsondoclint
18861887
[test] crate-bootstrap <host> src/tools/replace-version-placeholder
@@ -1915,7 +1916,7 @@ mod snapshot {
19151916
[doc] rustc (book) <host>
19161917
[test] rustc 1 <host> -> lint-docs 2 <host>
19171918
[doc] rustc 1 <host> -> std 1 <host> crates=[]
1918-
[test] rustc 1 <host> -> rustdoc-js-std 2 <host>
1919+
[test] rustdoc-js-std 1 <host>
19191920
[build] rustc 0 <host> -> RustdocTheme 1 <host>
19201921
[test] rustdoc-theme 1 <host>
19211922
[test] RustdocUi <host>

src/bootstrap/src/lib.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,14 +1130,18 @@ impl Build {
11301130
};
11311131

11321132
let action = action.into().description();
1133-
let msg = |fmt| format!("{action} stage{actual_stage} {what}{fmt}");
1133+
let what = what.to_string();
1134+
let msg = |fmt| {
1135+
let space = if !what.is_empty() { " " } else { "" };
1136+
format!("{action} stage{actual_stage} {what}{space}{fmt}")
1137+
};
11341138
let msg = if let Some(target) = target.into() {
11351139
let build_stage = host_and_stage.stage;
11361140
let host = host_and_stage.host;
11371141
if host == target {
1138-
msg(format_args!(" (stage{build_stage} -> stage{actual_stage}, {target})"))
1142+
msg(format_args!("(stage{build_stage} -> stage{actual_stage}, {target})"))
11391143
} else {
1140-
msg(format_args!(" (stage{build_stage}:{host} -> stage{actual_stage}:{target})"))
1144+
msg(format_args!("(stage{build_stage}:{host} -> stage{actual_stage}:{target})"))
11411145
}
11421146
} else {
11431147
msg(format_args!(""))

0 commit comments

Comments
 (0)