Auto merge of #112152 - jyn514:doc-msg, r=clubby789

Fix the progress message for `x doc rustc`

This makes it more clear that we're using stage 0 *to document* rustc, not that we're documenting stage0 rustc itself.

It also fixes a bug in `msg_sysroot_tool` that would print `Docing`, and removes the `Debug` impl for `Kind` to make sure it doesn't happen again.

Before:
```
Documenting stage0 compiler {rustc-main} (aarch64-apple-darwin)
```

After:
```
Documenting compiler {rustc-main} (stage0 -> stage1, aarch64-apple-darwin)
```

thanks `@BoxyUwU` for catching this!
This commit is contained in:
bors 2023-06-02 14:03:37 +00:00
commit a9baa16482
3 changed files with 10 additions and 7 deletions

View File

@ -571,7 +571,7 @@ fn pathset_for_paths_removing_matches(
}
}
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug, ValueEnum)]
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
pub enum Kind {
#[clap(alias = "b")]
Build,
@ -642,7 +642,10 @@ pub fn description(&self) -> String {
Kind::Doc => "Documenting",
Kind::Run => "Running",
Kind::Suggest => "Suggesting",
_ => return format!("{self:?}"),
_ => {
let title_letter = self.as_str()[0..1].to_ascii_uppercase();
return format!("{title_letter}{}ing", &self.as_str()[1..]);
}
}
.to_owned()
}

View File

@ -680,7 +680,7 @@ fn run(self, builder: &Builder<'_>) {
let compiler = builder.compiler(stage, builder.config.build);
builder.ensure(compile::Std::new(compiler, builder.config.build));
let _guard = builder.msg(
let _guard = builder.msg_sysroot_tool(
Kind::Doc,
stage,
&format!("compiler{}", crate_description(&self.crates)),

View File

@ -1045,8 +1045,8 @@ fn msg_unstaged(
what: impl Display,
target: TargetSelection,
) -> Option<gha::Group> {
let action = action.into();
let msg = format!("{action:?}ing {what} for {target}");
let action = action.into().description();
let msg = format!("{action} {what} for {target}");
self.group(&msg)
}
@ -1058,8 +1058,8 @@ fn msg_sysroot_tool(
host: TargetSelection,
target: TargetSelection,
) -> Option<gha::Group> {
let action = action.into();
let msg = |fmt| format!("{action:?}ing {what} {fmt}");
let action = action.into().description();
let msg = |fmt| format!("{action} {what} {fmt}");
let msg = if host == target {
msg(format_args!("(stage{stage} -> stage{}, {target})", stage + 1))
} else {