From b1527eecc0dbf16075738033a1b8fe5d23e8f243 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 5 Sep 2025 09:19:42 -0500 Subject: [PATCH] fix(shell): Switch to annotate snippets for notes --- src/cargo/core/shell.rs | 5 ++++- tests/testsuite/publish.rs | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/cargo/core/shell.rs b/src/cargo/core/shell.rs index ed1bbf76c78..77a3707f747 100644 --- a/src/cargo/core/shell.rs +++ b/src/cargo/core/shell.rs @@ -227,7 +227,10 @@ impl Shell { /// Prints a cyan 'note' message. pub fn note(&mut self, message: T) -> CargoResult<()> { - self.print(&"note", Some(&message), &NOTE, false) + let report = &[annotate_snippets::Group::with_title( + annotate_snippets::Level::NOTE.secondary_title(message.to_string()), + )]; + self.print_report(report, false) } /// Updates the verbosity of the shell. diff --git a/tests/testsuite/publish.rs b/tests/testsuite/publish.rs index 846b0689328..c3da82a4aec 100644 --- a/tests/testsuite/publish.rs +++ b/tests/testsuite/publish.rs @@ -3428,7 +3428,7 @@ See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for [UPLOADING] dep v0.0.1 ([ROOT]/foo/dep) [UPLOADED] dep v0.0.1 to registry `crates-io` [NOTE] waiting for dep v0.0.1 to be available at registry `crates-io`. -2 remaining crates to be published + 2 remaining crates to be published [WARNING] timed out waiting for dep v0.0.1 to be available in registry `crates-io` [NOTE] the registry may have a backlog that is delaying making the crate available. The crate should be available soon. [ERROR] unable to publish main v0.0.1 and other v0.0.1 due to a timeout while waiting for published dependencies to be available. @@ -3751,12 +3751,12 @@ fn workspace_with_local_deps() { [UPLOADING] level3 v0.0.1 ([ROOT]/foo/level3) [UPLOADED] level3 v0.0.1 to registry `crates-io` [NOTE] waiting for level3 v0.0.1 to be available at registry `crates-io`. -2 remaining crates to be published + 2 remaining crates to be published [PUBLISHED] level3 v0.0.1 at registry `crates-io` [UPLOADING] level2 v0.0.1 ([ROOT]/foo/level2) [UPLOADED] level2 v0.0.1 to registry `crates-io` [NOTE] waiting for level2 v0.0.1 to be available at registry `crates-io`. -1 remaining crate to be published + 1 remaining crate to be published [PUBLISHED] level2 v0.0.1 at registry `crates-io` [UPLOADING] level1 v0.0.1 ([ROOT]/foo/level1) [UPLOADED] level1 v0.0.1 to registry `crates-io` @@ -3855,7 +3855,7 @@ fn workspace_parallel() { [UPLOADED] b v0.0.1 to registry `crates-io` [UPLOADED] a v0.0.1 to registry `crates-io` [NOTE] waiting for a v0.0.1 or b v0.0.1 to be available at registry `crates-io`. -1 remaining crate to be published + 1 remaining crate to be published [PUBLISHED] a v0.0.1 and b v0.0.1 at registry `crates-io` [UPLOADING] c v0.0.1 ([ROOT]/foo/c) [UPLOADED] c v0.0.1 to registry `crates-io`