Fix spacing when testing individual crates

This commit is contained in:
Jakub Beránek 2025-08-20 17:09:02 +02:00
parent 0b3a13c9c0
commit ef569d3ce3
No known key found for this signature in database
GPG key ID: 909CD0D26483516B
3 changed files with 11 additions and 6 deletions

View file

@ -295,7 +295,7 @@ pub fn crate_description(crates: &[impl AsRef<str>]) -> String {
return "".into();
}
let mut descr = String::from(" {");
let mut descr = String::from("{");
descr.push_str(crates[0].as_ref());
for krate in &crates[1..] {
descr.push_str(", ");

View file

@ -2064,9 +2064,10 @@ mod snapshot {
[test] CoverageRunRustdoc <host>
[test] Pretty <host>
[build] rustc 1 <host> -> std 1 <host>
[build] rustc 0 <host> -> std 0 <host>
[build] rustdoc 0 <host>
[test] CrateLibrustc <host>
[build] rustc 1 <host> -> rustc 2 <host>
[build] rustdoc 0 <host>
[test] crate-bootstrap <host> src/tools/coverage-dump
[test] crate-bootstrap <host> src/tools/jsondoclint
[test] crate-bootstrap <host> src/tools/replace-version-placeholder
@ -2101,7 +2102,7 @@ mod snapshot {
[doc] rustc (book) <host>
[test] rustc 1 <host> -> lint-docs 2 <host>
[doc] rustc 1 <host> -> std 1 <host> crates=[]
[test] rustc 1 <host> -> rustdoc-js-std 2 <host>
[test] rustdoc-js-std 1 <host>
[build] rustc 0 <host> -> RustdocTheme 1 <host>
[test] rustdoc-theme 1 <host>
[test] RustdocUi <host>

View file

@ -1144,14 +1144,18 @@ impl Build {
};
let action = action.into().description();
let msg = |fmt| format!("{action} stage{actual_stage} {what}{fmt}");
let what = what.to_string();
let msg = |fmt| {
let space = if !what.is_empty() { " " } else { "" };
format!("{action} stage{actual_stage} {what}{space}{fmt}")
};
let msg = if let Some(target) = target.into() {
let build_stage = host_and_stage.stage;
let host = host_and_stage.host;
if host == target {
msg(format_args!(" (stage{build_stage} -> stage{actual_stage}, {target})"))
msg(format_args!("(stage{build_stage} -> stage{actual_stage}, {target})"))
} else {
msg(format_args!(" (stage{build_stage}:{host} -> stage{actual_stage}:{target})"))
msg(format_args!("(stage{build_stage}:{host} -> stage{actual_stage}:{target})"))
}
} else {
msg(format_args!(""))