From b4863628df4918cd2f9917d6d6ea129c82b472ee Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 29 Sep 2025 08:43:21 -0500 Subject: [PATCH 1/3] refactor(shell): Clarify we're printing transient status --- src/cargo/core/shell.rs | 2 +- src/cargo/util/progress.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cargo/core/shell.rs b/src/cargo/core/shell.rs index 77a3707f747..1de947b41b0 100644 --- a/src/cargo/core/shell.rs +++ b/src/cargo/core/shell.rs @@ -168,7 +168,7 @@ impl Shell { self.print(&status, Some(&message), &HEADER, true) } - pub fn status_header(&mut self, status: T) -> CargoResult<()> + pub fn transient_status(&mut self, status: T) -> CargoResult<()> where T: fmt::Display, { diff --git a/src/cargo/util/progress.rs b/src/cargo/util/progress.rs index f212a496e14..c79f9656dbc 100644 --- a/src/cargo/util/progress.rs +++ b/src/cargo/util/progress.rs @@ -429,7 +429,7 @@ impl<'gctx> State<'gctx> { if self.gctx.shell().is_cleared() || self.last_line.as_ref() != Some(&line) { let mut shell = self.gctx.shell(); shell.set_needs_clear(false); - shell.status_header(&self.name)?; + shell.transient_status(&self.name)?; if let Some(tb) = report { write!(shell.err(), "{line}{tb}\r")?; } else { From 92182d44272277d46829831eb9589dc1b79da9c9 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 29 Sep 2025 08:44:00 -0500 Subject: [PATCH 2/3] refactor(shell): Create separaete style definition for transient --- src/cargo/core/shell.rs | 2 +- src/cargo/util/style.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cargo/core/shell.rs b/src/cargo/core/shell.rs index 1de947b41b0..6a5077dd1b5 100644 --- a/src/cargo/core/shell.rs +++ b/src/cargo/core/shell.rs @@ -172,7 +172,7 @@ impl Shell { where T: fmt::Display, { - self.print(&status, None, &NOTE, true) + self.print(&status, None, &TRANSIENT, true) } /// Shortcut to right-align a status message. diff --git a/src/cargo/util/style.rs b/src/cargo/util/style.rs index 824f42b59b4..7ea6d287d7f 100644 --- a/src/cargo/util/style.rs +++ b/src/cargo/util/style.rs @@ -11,3 +11,4 @@ pub const NOTE: Style = annotate_snippets::renderer::DEFAULT_NOTE_STYLE; pub const GOOD: Style = AnsiColor::BrightGreen.on_default().effects(Effects::BOLD); pub const VALID: Style = AnsiColor::BrightCyan.on_default().effects(Effects::BOLD); pub const INVALID: Style = annotate_snippets::renderer::DEFAULT_WARNING_STYLE; +pub const TRANSIENT: Style = NOTE; From d33f651e77782c51cb6dabafdf75f8412355d405 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 29 Sep 2025 08:45:24 -0500 Subject: [PATCH 3/3] fix(shell): Use a distinct style for transient status PR #15928 made `Checking` and `Building` the same style because the transient state is `note:` and #15928 made `note:~ the same as our regular headers. This switches the transient state to `help:` until we can further explore color choices with rustc. See also https://rust-lang.zulipchat.com/#narrow/channel/246057-t-cargo/topic/colors.20removed.20in.201.2E91.20.28current.20beta.29.3F/near/541900531 --- src/cargo/util/style.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cargo/util/style.rs b/src/cargo/util/style.rs index 7ea6d287d7f..24e66952170 100644 --- a/src/cargo/util/style.rs +++ b/src/cargo/util/style.rs @@ -11,4 +11,4 @@ pub const NOTE: Style = annotate_snippets::renderer::DEFAULT_NOTE_STYLE; pub const GOOD: Style = AnsiColor::BrightGreen.on_default().effects(Effects::BOLD); pub const VALID: Style = AnsiColor::BrightCyan.on_default().effects(Effects::BOLD); pub const INVALID: Style = annotate_snippets::renderer::DEFAULT_WARNING_STYLE; -pub const TRANSIENT: Style = NOTE; +pub const TRANSIENT: Style = annotate_snippets::renderer::DEFAULT_HELP_STYLE;