From 1b9265ca73c92cf17347d2dc3d3fa9ba0bf8a04c Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 8 Sep 2025 15:05:16 -0500 Subject: [PATCH] fix(future): Remove leading newline to match note conventions --- src/cargo/core/compiler/future_incompat.rs | 7 +------ tests/testsuite/future_incompat_report.rs | 14 ++++---------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/cargo/core/compiler/future_incompat.rs b/src/cargo/core/compiler/future_incompat.rs index 8cbc42b62..8517a5106 100644 --- a/src/cargo/core/compiler/future_incompat.rs +++ b/src/cargo/core/compiler/future_incompat.rs @@ -496,12 +496,7 @@ https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch String::new() } else { let mut suggestion_message = String::new(); - writeln!( - &mut suggestion_message, - " -{suggestion_header}" - ) - .unwrap(); + writeln!(&mut suggestion_message, "{suggestion_header}").unwrap(); for suggestion in &suggestions { writeln!( &mut suggestion_message, diff --git a/tests/testsuite/future_incompat_report.rs b/tests/testsuite/future_incompat_report.rs index a64a6f7df..168ee759e 100644 --- a/tests/testsuite/future_incompat_report.rs +++ b/tests/testsuite/future_incompat_report.rs @@ -146,8 +146,7 @@ fn incompat_in_dependency() { .with_stderr_data(str![[r#" [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [WARNING] the following packages contain code that will be rejected by a future version of Rust: bar v1.0.0 -[NOTE] -To solve this problem, you can try the following approaches: +[NOTE] To solve this problem, you can try the following approaches: - If the issue is not solved by updating the dependencies, a fix has to be implemented by those dependencies. You can help with that by notifying the @@ -180,7 +179,6 @@ to be in wide use. Each warning should contain a link for more information on what the warning means and how to resolve it. - To solve this problem, you can try the following approaches: - If the issue is not solved by updating the dependencies, a fix has to be @@ -603,8 +601,7 @@ fn suggestions_for_updates() { [CHECKING] foo v0.1.0 ([ROOT]/foo) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [WARNING] the following packages contain code that will be rejected by a future version of Rust: big_update v1.0.0, with_updates v1.0.0, without_updates v1.0.0 -[NOTE] -To solve this problem, you can try the following approaches: +[NOTE] To solve this problem, you can try the following approaches: - Some affected dependencies have newer versions available. You may want to consider updating them to a newer version to see if the issue has been fixed. @@ -651,7 +648,6 @@ to be in wide use. Each warning should contain a link for more information on what the warning means and how to resolve it. - To solve this problem, you can try the following approaches: - Some affected dependencies have newer versions available. @@ -718,8 +714,7 @@ fn correct_report_id_when_cached() { [CHECKING] foo v1.0.0 ([ROOT]/foo) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [WARNING] the following packages contain code that will be rejected by a future version of Rust: bar v1.0.0 -[NOTE] -To solve this problem, you can try the following approaches: +[NOTE] To solve this problem, you can try the following approaches: - If the issue is not solved by updating the dependencies, a fix has to be implemented by those dependencies. You can help with that by notifying the @@ -745,8 +740,7 @@ https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch .with_stderr_data(str![[r#" [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [WARNING] the following packages contain code that will be rejected by a future version of Rust: bar v1.0.0 -[NOTE] -To solve this problem, you can try the following approaches: +[NOTE] To solve this problem, you can try the following approaches: - If the issue is not solved by updating the dependencies, a fix has to be implemented by those dependencies. You can help with that by notifying the