From 322b82a2e07fe6d96cf3e68dc8b3e8571a05666f Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 9 Sep 2025 16:09:30 -0500 Subject: [PATCH 01/11] test(future): Serialize output to avoid unordered Parallel isn't part of this test and it makes snapshot updating annoying. --- tests/testsuite/future_incompat_report.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/testsuite/future_incompat_report.rs b/tests/testsuite/future_incompat_report.rs index e60c15c425b..945fe12136d 100644 --- a/tests/testsuite/future_incompat_report.rs +++ b/tests/testsuite/future_incompat_report.rs @@ -539,9 +539,11 @@ fn suggestions_for_updates() { .publish(); Package::new("big_update", "1.0.0") .file("src/lib.rs", FUTURE_EXAMPLE) + .dep("with_updates", "1.0.0") .publish(); Package::new("without_updates", "1.0.0") .file("src/lib.rs", FUTURE_EXAMPLE) + .dep("big_update", "1.0.0") .publish(); let p = project() @@ -575,6 +577,7 @@ fn suggestions_for_updates() { .publish(); Package::new("big_update", "2.0.0") .file("src/lib.rs", "") + .dep("with_updates", "1.0.0") .publish(); // This is a hack to force cargo to update the index. Cargo can't do this @@ -610,7 +613,6 @@ You may want to consider updating them to a newer version to see if the issue ha big_update v1.0.0 has the following newer versions available: 2.0.0 with_updates v1.0.0 has the following newer versions available: 1.0.1, 1.0.2, 3.0.1 - - 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 maintainers of this problem (e.g. by creating a bug report) or by proposing a @@ -632,9 +634,10 @@ fix to the maintainers (e.g. by creating a pull request): section in `Cargo.toml` to use your own version of the dependency. For more information, see: https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section + [NOTE] this report can be shown with `cargo report future-incompatibilities --id 1` -"#]].unordered()) +"#]]) .run(); p.cargo("report future-incompatibilities") From acf54a080efc3173241b4611bcf328f2bfa51479 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 8 Sep 2025 15:08:51 -0500 Subject: [PATCH 02/11] refactor(future): Group shell output --- src/cargo/core/compiler/future_incompat.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/cargo/core/compiler/future_incompat.rs b/src/cargo/core/compiler/future_incompat.rs index c7501bd3f0c..fc18d83782b 100644 --- a/src/cargo/core/compiler/future_incompat.rs +++ b/src/cargo/core/compiler/future_incompat.rs @@ -428,14 +428,6 @@ pub fn save_and_display_report( .collect(); let package_vers: Vec<_> = package_ids.iter().map(|pid| pid.to_string()).collect(); - if should_display_message || bcx.build_config.future_incompat_report { - drop(bcx.gctx.shell().warn(&format!( - "the following packages contain code that will be rejected by a future \ - version of Rust: {}", - package_vers.join(", ") - ))); - } - let updated_versions = get_updates(bcx.ws, &package_ids).unwrap_or(String::new()); let update_message = if !updated_versions.is_empty() { @@ -503,6 +495,13 @@ https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch let saved_report_id = current_reports.save_report(bcx.ws, suggestion_message.clone(), rendered_report); + if should_display_message || bcx.build_config.future_incompat_report { + drop(bcx.gctx.shell().warn(&format!( + "the following packages contain code that will be rejected by a future \ + version of Rust: {}", + package_vers.join(", ") + ))); + } if bcx.build_config.future_incompat_report { if !suggestion_message.is_empty() { drop(bcx.gctx.shell().note(&suggestion_message)); From 9e401f67f6f8ad7f8df07893b0e1842b8ff0b76a Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 8 Sep 2025 15:09:11 -0500 Subject: [PATCH 03/11] refactor(future): Group shell output --- src/cargo/core/compiler/future_incompat.rs | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/cargo/core/compiler/future_incompat.rs b/src/cargo/core/compiler/future_incompat.rs index fc18d83782b..64f32139064 100644 --- a/src/cargo/core/compiler/future_incompat.rs +++ b/src/cargo/core/compiler/future_incompat.rs @@ -501,22 +501,22 @@ https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch version of Rust: {}", package_vers.join(", ") ))); - } - if bcx.build_config.future_incompat_report { - if !suggestion_message.is_empty() { - drop(bcx.gctx.shell().note(&suggestion_message)); - } - drop(bcx.gctx.shell().note(&format!( - "this report can be shown with `cargo report \ + if bcx.build_config.future_incompat_report { + if !suggestion_message.is_empty() { + drop(bcx.gctx.shell().note(&suggestion_message)); + } + drop(bcx.gctx.shell().note(&format!( + "this report can be shown with `cargo report \ future-incompatibilities --id {}`", - saved_report_id - ))); - } else if should_display_message { - drop(bcx.gctx.shell().note(&format!( - "to see what the problems were, use the option \ + saved_report_id + ))); + } else if should_display_message { + drop(bcx.gctx.shell().note(&format!( + "to see what the problems were, use the option \ `--future-incompat-report`, or run `cargo report \ future-incompatibilities --id {}`", - saved_report_id - ))); + saved_report_id + ))); + } } } From 782df7300d3340fe475ef861d1dd882312cf7554 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 9 Sep 2025 16:44:20 -0500 Subject: [PATCH 04/11] refactor(future): Separate out suggestions from rendering This will make it easier later to put each in their own message/title in annotate snippets. The hack will be removed later in this series. --- src/cargo/core/compiler/future_incompat.rs | 74 ++++++++++++++-------- 1 file changed, 49 insertions(+), 25 deletions(-) diff --git a/src/cargo/core/compiler/future_incompat.rs b/src/cargo/core/compiler/future_incompat.rs index 64f32139064..450d00424da 100644 --- a/src/cargo/core/compiler/future_incompat.rs +++ b/src/cargo/core/compiler/future_incompat.rs @@ -359,9 +359,10 @@ fn get_updates(ws: &Workspace<'_>, package_ids: &BTreeSet) -> Option< if !updated_versions.is_empty() { let updated_versions = itertools::join(updated_versions, ", "); - writeln!( + write!( updates, - "{} has the following newer versions available: {}", + " +{} has the following newer versions available: {}", pkg_id, updated_versions ) .unwrap(); @@ -432,11 +433,10 @@ pub fn save_and_display_report( let update_message = if !updated_versions.is_empty() { format!( - " -- Some affected dependencies have newer versions available. + "\ +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. - -{updated_versions}\n", +{updated_versions}", updated_versions = updated_versions ) } else { @@ -448,8 +448,7 @@ You may want to consider updating them to a newer version to see if the issue ha .map(|package_id| { let manifest = bcx.packages.get_one(*package_id).unwrap().manifest(); format!( - " - - {package_spec} + " - {package_spec} - Repository: {url} - Detailed warning command: `cargo report future-incompatibilities --id {id} --package {package_spec}`", package_spec = format!("{}@{}", package_id.name(), package_id.version()), @@ -462,36 +461,61 @@ You may want to consider updating them to a newer version to see if the issue ha ) }) .collect::>() - .join("\n"); + .join("\n\n"); let all_is_local = per_package_future_incompat_reports .iter() .all(|report| report.is_local); - let suggestion_message = if all_is_local { - String::new() - } else { - format!( - " -To solve this problem, you can try the following approaches: - -{update_message}\ -- If the issue is not solved by updating the dependencies, a fix has to be + let suggestion_header = "To solve this problem, you can try the following approaches:"; + let mut suggestions = Vec::new(); + if !all_is_local { + if !update_message.is_empty() { + suggestions.push(update_message); + } + suggestions.push(format!( + "\ +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 maintainers of this problem (e.g. by creating a bug report) or by proposing a fix to the maintainers (e.g. by creating a pull request): -{upstream_info} -- If waiting for an upstream fix is not an option, you can use the `[patch]` +{upstream_info}" + )); + suggestions.push( + "\ +If waiting for an upstream fix is not an option, you can use the `[patch]` section in `Cargo.toml` to use your own version of the dependency. For more information, see: -https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section -", - upstream_info = upstream_info, - update_message = update_message, +https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section" + .to_owned(), + ); + } + + let suggestion_message = if suggestions.is_empty() { + String::new() + } else { + let mut suggestion_message = String::new(); + writeln!( + &mut suggestion_message, + " +{suggestion_header}" ) + .unwrap(); + if suggestions.len() == 3 { + // HACK: there is an inconsistent leading line in this case + writeln!(&mut suggestion_message).unwrap(); + } + for suggestion in &suggestions { + writeln!( + &mut suggestion_message, + " +- {suggestion}" + ) + .unwrap(); + } + suggestion_message }; - let saved_report_id = current_reports.save_report(bcx.ws, suggestion_message.clone(), rendered_report); From 8682394e7b1f3cc1f8386b8ae3c6edeee2069ecf Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 9 Sep 2025 17:01:52 -0500 Subject: [PATCH 05/11] fix(future): Be consistent in suggestion spacing --- src/cargo/core/compiler/future_incompat.rs | 4 ---- tests/testsuite/future_incompat_report.rs | 2 -- 2 files changed, 6 deletions(-) diff --git a/src/cargo/core/compiler/future_incompat.rs b/src/cargo/core/compiler/future_incompat.rs index 450d00424da..8cbc42b6228 100644 --- a/src/cargo/core/compiler/future_incompat.rs +++ b/src/cargo/core/compiler/future_incompat.rs @@ -502,10 +502,6 @@ https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch {suggestion_header}" ) .unwrap(); - if suggestions.len() == 3 { - // HACK: there is an inconsistent leading line in this case - writeln!(&mut suggestion_message).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 945fe12136d..a64a6f7dfdf 100644 --- a/tests/testsuite/future_incompat_report.rs +++ b/tests/testsuite/future_incompat_report.rs @@ -606,7 +606,6 @@ fn suggestions_for_updates() { [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. @@ -655,7 +654,6 @@ means and how to resolve it. 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. From 1b9265ca73c92cf17347d2dc3d3fa9ba0bf8a04c Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 8 Sep 2025 15:05:16 -0500 Subject: [PATCH 06/11] 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 8cbc42b6228..8517a5106fb 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 a64a6f7dfdf..168ee759e98 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 From 95aa52c1779733ec747ef5cfbb7509da6ff73b83 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 9 Sep 2025 16:13:06 -0500 Subject: [PATCH 07/11] fix(future): Indent potential candidates This better matches other sub-lists --- src/cargo/core/compiler/future_incompat.rs | 2 +- tests/testsuite/future_incompat_report.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cargo/core/compiler/future_incompat.rs b/src/cargo/core/compiler/future_incompat.rs index 8517a5106fb..f90ad80dc5a 100644 --- a/src/cargo/core/compiler/future_incompat.rs +++ b/src/cargo/core/compiler/future_incompat.rs @@ -362,7 +362,7 @@ fn get_updates(ws: &Workspace<'_>, package_ids: &BTreeSet) -> Option< write!( updates, " -{} has the following newer versions available: {}", + - {} has the following newer versions available: {}", pkg_id, updated_versions ) .unwrap(); diff --git a/tests/testsuite/future_incompat_report.rs b/tests/testsuite/future_incompat_report.rs index 168ee759e98..1f0cf103c9f 100644 --- a/tests/testsuite/future_incompat_report.rs +++ b/tests/testsuite/future_incompat_report.rs @@ -606,8 +606,8 @@ fn suggestions_for_updates() { - 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. -big_update v1.0.0 has the following newer versions available: 2.0.0 -with_updates v1.0.0 has the following newer versions available: 1.0.1, 1.0.2, 3.0.1 + - big_update v1.0.0 has the following newer versions available: 2.0.0 + - with_updates v1.0.0 has the following newer versions available: 1.0.1, 1.0.2, 3.0.1 - 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 @@ -653,8 +653,8 @@ 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. -big_update v1.0.0 has the following newer versions available: 2.0.0 -with_updates v1.0.0 has the following newer versions available: 1.0.1, 1.0.2, 3.0.1 + - big_update v1.0.0 has the following newer versions available: 2.0.0 + - with_updates v1.0.0 has the following newer versions available: 1.0.1, 1.0.2, 3.0.1 - 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 From 155255fe41fea4be211f2730087a462f23f2bf1a Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 9 Sep 2025 16:34:32 -0500 Subject: [PATCH 08/11] fix(future): Lead with the suggested action --- src/cargo/core/compiler/future_incompat.rs | 14 ++--- tests/testsuite/future_incompat_report.rs | 72 ++++++++-------------- 2 files changed, 31 insertions(+), 55 deletions(-) diff --git a/src/cargo/core/compiler/future_incompat.rs b/src/cargo/core/compiler/future_incompat.rs index f90ad80dc5a..9317f09e678 100644 --- a/src/cargo/core/compiler/future_incompat.rs +++ b/src/cargo/core/compiler/future_incompat.rs @@ -434,8 +434,7 @@ pub fn save_and_display_report( let update_message = if !updated_versions.is_empty() { format!( "\ -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. +Update to a newer version to see if the issue has been fixed: {updated_versions}", updated_versions = updated_versions ) @@ -475,18 +474,15 @@ You may want to consider updating them to a newer version to see if the issue ha } suggestions.push(format!( "\ -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 -maintainers of this problem (e.g. by creating a bug report) or by proposing a -fix to the maintainers (e.g. by creating a pull request): +Ensure the maintainers know of this problem (e.g. creating a bug report if needed) +or even helping with a fix (e.g. by creating a pull request): {upstream_info}" )); suggestions.push( "\ -If waiting for an upstream fix is not an option, you can use the `[patch]` -section in `Cargo.toml` to use your own version of the dependency. For more -information, see: +Use your own version of the dependency with the `[patch]` section in `Cargo.toml`. +For more information, see: https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section" .to_owned(), ); diff --git a/tests/testsuite/future_incompat_report.rs b/tests/testsuite/future_incompat_report.rs index 1f0cf103c9f..6e5152ab0c2 100644 --- a/tests/testsuite/future_incompat_report.rs +++ b/tests/testsuite/future_incompat_report.rs @@ -148,18 +148,15 @@ fn incompat_in_dependency() { [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: -- 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 -maintainers of this problem (e.g. by creating a bug report) or by proposing a -fix to the maintainers (e.g. by creating a pull request): +- Ensure the maintainers know of this problem (e.g. creating a bug report if needed) +or even helping with a fix (e.g. by creating a pull request): - bar@1.0.0 - Repository: https://example.com/ - Detailed warning command: `cargo report future-incompatibilities --id 1 --package bar@1.0.0` -- If waiting for an upstream fix is not an option, you can use the `[patch]` -section in `Cargo.toml` to use your own version of the dependency. For more -information, see: +- Use your own version of the dependency with the `[patch]` section in `Cargo.toml`. +For more information, see: https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section [NOTE] this report can be shown with `cargo report future-incompatibilities --id 1` @@ -181,18 +178,15 @@ 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 -implemented by those dependencies. You can help with that by notifying the -maintainers of this problem (e.g. by creating a bug report) or by proposing a -fix to the maintainers (e.g. by creating a pull request): +- Ensure the maintainers know of this problem (e.g. creating a bug report if needed) +or even helping with a fix (e.g. by creating a pull request): - bar@1.0.0 - Repository: https://example.com/ - Detailed warning command: `cargo report future-incompatibilities --id 1 --package bar@1.0.0` -- If waiting for an upstream fix is not an option, you can use the `[patch]` -section in `Cargo.toml` to use your own version of the dependency. For more -information, see: +- Use your own version of the dependency with the `[patch]` section in `Cargo.toml`. +For more information, see: https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section The package `bar v1.0.0` currently triggers the following future incompatibility lints: @@ -603,16 +597,13 @@ fn suggestions_for_updates() { [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: -- 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. +- Update to a newer version to see if the issue has been fixed: - big_update v1.0.0 has the following newer versions available: 2.0.0 - with_updates v1.0.0 has the following newer versions available: 1.0.1, 1.0.2, 3.0.1 -- 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 -maintainers of this problem (e.g. by creating a bug report) or by proposing a -fix to the maintainers (e.g. by creating a pull request): +- Ensure the maintainers know of this problem (e.g. creating a bug report if needed) +or even helping with a fix (e.g. by creating a pull request): - big_update@1.0.0 - Repository: @@ -626,9 +617,8 @@ fix to the maintainers (e.g. by creating a pull request): - Repository: - Detailed warning command: `cargo report future-incompatibilities --id 1 --package without_updates@1.0.0` -- If waiting for an upstream fix is not an option, you can use the `[patch]` -section in `Cargo.toml` to use your own version of the dependency. For more -information, see: +- Use your own version of the dependency with the `[patch]` section in `Cargo.toml`. +For more information, see: https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section [NOTE] this report can be shown with `cargo report future-incompatibilities --id 1` @@ -650,16 +640,13 @@ means and how to resolve it. 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. +- Update to a newer version to see if the issue has been fixed: - big_update v1.0.0 has the following newer versions available: 2.0.0 - with_updates v1.0.0 has the following newer versions available: 1.0.1, 1.0.2, 3.0.1 -- 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 -maintainers of this problem (e.g. by creating a bug report) or by proposing a -fix to the maintainers (e.g. by creating a pull request): +- Ensure the maintainers know of this problem (e.g. creating a bug report if needed) +or even helping with a fix (e.g. by creating a pull request): - big_update@1.0.0 - Repository: @@ -673,9 +660,8 @@ fix to the maintainers (e.g. by creating a pull request): - Repository: - Detailed warning command: `cargo report future-incompatibilities --id 1 --package without_updates@1.0.0` -- If waiting for an upstream fix is not an option, you can use the `[patch]` -section in `Cargo.toml` to use your own version of the dependency. For more -information, see: +- Use your own version of the dependency with the `[patch]` section in `Cargo.toml`. +For more information, see: https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section The package `big_update v1.0.0` currently triggers the following future incompatibility lints: @@ -716,18 +702,15 @@ fn correct_report_id_when_cached() { [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: -- 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 -maintainers of this problem (e.g. by creating a bug report) or by proposing a -fix to the maintainers (e.g. by creating a pull request): +- Ensure the maintainers know of this problem (e.g. creating a bug report if needed) +or even helping with a fix (e.g. by creating a pull request): - bar@1.0.0 - Repository: https://example.com/ - Detailed warning command: `cargo report future-incompatibilities --id 1 --package bar@1.0.0` -- If waiting for an upstream fix is not an option, you can use the `[patch]` -section in `Cargo.toml` to use your own version of the dependency. For more -information, see: +- Use your own version of the dependency with the `[patch]` section in `Cargo.toml`. +For more information, see: https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section [NOTE] this report can be shown with `cargo report future-incompatibilities --id 1` @@ -742,18 +725,15 @@ https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch [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: -- 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 -maintainers of this problem (e.g. by creating a bug report) or by proposing a -fix to the maintainers (e.g. by creating a pull request): +- Ensure the maintainers know of this problem (e.g. creating a bug report if needed) +or even helping with a fix (e.g. by creating a pull request): - bar@1.0.0 - Repository: https://example.com/ - Detailed warning command: `cargo report future-incompatibilities --id 1 --package bar@1.0.0` -- If waiting for an upstream fix is not an option, you can use the `[patch]` -section in `Cargo.toml` to use your own version of the dependency. For more -information, see: +- Use your own version of the dependency with the `[patch]` section in `Cargo.toml`. +For more information, see: https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section [NOTE] this report can be shown with `cargo report future-incompatibilities --id 1` From 54ce51c3434def3c3fcb27fb6658d89124548136 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 9 Sep 2025 16:36:20 -0500 Subject: [PATCH 09/11] fix(future): Lead with non-capital letter Per rustc dev guide --- src/cargo/core/compiler/future_incompat.rs | 14 ++-- tests/testsuite/future_incompat_report.rs | 92 +++++++++++----------- 2 files changed, 53 insertions(+), 53 deletions(-) diff --git a/src/cargo/core/compiler/future_incompat.rs b/src/cargo/core/compiler/future_incompat.rs index 9317f09e678..5e87e9945f0 100644 --- a/src/cargo/core/compiler/future_incompat.rs +++ b/src/cargo/core/compiler/future_incompat.rs @@ -434,7 +434,7 @@ pub fn save_and_display_report( let update_message = if !updated_versions.is_empty() { format!( "\ -Update to a newer version to see if the issue has been fixed: +update to a newer version to see if the issue has been fixed {updated_versions}", updated_versions = updated_versions ) @@ -448,8 +448,8 @@ Update to a newer version to see if the issue has been fixed: let manifest = bcx.packages.get_one(*package_id).unwrap().manifest(); format!( " - {package_spec} - - Repository: {url} - - Detailed warning command: `cargo report future-incompatibilities --id {id} --package {package_spec}`", + - repository: {url} + - detailed warning command: `cargo report future-incompatibilities --id {id} --package {package_spec}`", package_spec = format!("{}@{}", package_id.name(), package_id.version()), url = manifest .metadata() @@ -466,7 +466,7 @@ Update to a newer version to see if the issue has been fixed: .iter() .all(|report| report.is_local); - let suggestion_header = "To solve this problem, you can try the following approaches:"; + let suggestion_header = "to solve this problem, you can try the following approaches:"; let mut suggestions = Vec::new(); if !all_is_local { if !update_message.is_empty() { @@ -474,14 +474,14 @@ Update to a newer version to see if the issue has been fixed: } suggestions.push(format!( "\ -Ensure the maintainers know of this problem (e.g. creating a bug report if needed) -or even helping with a fix (e.g. by creating a pull request): +ensure the maintainers know of this problem (e.g. creating a bug report if needed) +or even helping with a fix (e.g. by creating a pull request) {upstream_info}" )); suggestions.push( "\ -Use your own version of the dependency with the `[patch]` section in `Cargo.toml`. +use your own version of the dependency with the `[patch]` section in `Cargo.toml` For more information, see: https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section" .to_owned(), diff --git a/tests/testsuite/future_incompat_report.rs b/tests/testsuite/future_incompat_report.rs index 6e5152ab0c2..cbab4f05e37 100644 --- a/tests/testsuite/future_incompat_report.rs +++ b/tests/testsuite/future_incompat_report.rs @@ -146,16 +146,16 @@ 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: -- Ensure the maintainers know of this problem (e.g. creating a bug report if needed) -or even helping with a fix (e.g. by creating a pull request): +- ensure the maintainers know of this problem (e.g. creating a bug report if needed) +or even helping with a fix (e.g. by creating a pull request) - bar@1.0.0 - - Repository: https://example.com/ - - Detailed warning command: `cargo report future-incompatibilities --id 1 --package bar@1.0.0` + - repository: https://example.com/ + - detailed warning command: `cargo report future-incompatibilities --id 1 --package bar@1.0.0` -- Use your own version of the dependency with the `[patch]` section in `Cargo.toml`. +- use your own version of the dependency with the `[patch]` section in `Cargo.toml` For more information, see: https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section @@ -176,16 +176,16 @@ 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: +to solve this problem, you can try the following approaches: -- Ensure the maintainers know of this problem (e.g. creating a bug report if needed) -or even helping with a fix (e.g. by creating a pull request): +- ensure the maintainers know of this problem (e.g. creating a bug report if needed) +or even helping with a fix (e.g. by creating a pull request) - bar@1.0.0 - - Repository: https://example.com/ - - Detailed warning command: `cargo report future-incompatibilities --id 1 --package bar@1.0.0` + - repository: https://example.com/ + - detailed warning command: `cargo report future-incompatibilities --id 1 --package bar@1.0.0` -- Use your own version of the dependency with the `[patch]` section in `Cargo.toml`. +- use your own version of the dependency with the `[patch]` section in `Cargo.toml` For more information, see: https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section @@ -595,29 +595,29 @@ 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: -- Update to a newer version to see if the issue has been fixed: +- update to a newer version to see if the issue has been fixed - big_update v1.0.0 has the following newer versions available: 2.0.0 - with_updates v1.0.0 has the following newer versions available: 1.0.1, 1.0.2, 3.0.1 -- Ensure the maintainers know of this problem (e.g. creating a bug report if needed) -or even helping with a fix (e.g. by creating a pull request): +- ensure the maintainers know of this problem (e.g. creating a bug report if needed) +or even helping with a fix (e.g. by creating a pull request) - big_update@1.0.0 - - Repository: - - Detailed warning command: `cargo report future-incompatibilities --id 1 --package big_update@1.0.0` + - repository: + - detailed warning command: `cargo report future-incompatibilities --id 1 --package big_update@1.0.0` - with_updates@1.0.0 - - Repository: - - Detailed warning command: `cargo report future-incompatibilities --id 1 --package with_updates@1.0.0` + - repository: + - detailed warning command: `cargo report future-incompatibilities --id 1 --package with_updates@1.0.0` - without_updates@1.0.0 - - Repository: - - Detailed warning command: `cargo report future-incompatibilities --id 1 --package without_updates@1.0.0` + - repository: + - detailed warning command: `cargo report future-incompatibilities --id 1 --package without_updates@1.0.0` -- Use your own version of the dependency with the `[patch]` section in `Cargo.toml`. +- use your own version of the dependency with the `[patch]` section in `Cargo.toml` For more information, see: https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section @@ -638,29 +638,29 @@ 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: +to solve this problem, you can try the following approaches: -- Update to a newer version to see if the issue has been fixed: +- update to a newer version to see if the issue has been fixed - big_update v1.0.0 has the following newer versions available: 2.0.0 - with_updates v1.0.0 has the following newer versions available: 1.0.1, 1.0.2, 3.0.1 -- Ensure the maintainers know of this problem (e.g. creating a bug report if needed) -or even helping with a fix (e.g. by creating a pull request): +- ensure the maintainers know of this problem (e.g. creating a bug report if needed) +or even helping with a fix (e.g. by creating a pull request) - big_update@1.0.0 - - Repository: - - Detailed warning command: `cargo report future-incompatibilities --id 1 --package big_update@1.0.0` + - repository: + - detailed warning command: `cargo report future-incompatibilities --id 1 --package big_update@1.0.0` - with_updates@1.0.0 - - Repository: - - Detailed warning command: `cargo report future-incompatibilities --id 1 --package with_updates@1.0.0` + - repository: + - detailed warning command: `cargo report future-incompatibilities --id 1 --package with_updates@1.0.0` - without_updates@1.0.0 - - Repository: - - Detailed warning command: `cargo report future-incompatibilities --id 1 --package without_updates@1.0.0` + - repository: + - detailed warning command: `cargo report future-incompatibilities --id 1 --package without_updates@1.0.0` -- Use your own version of the dependency with the `[patch]` section in `Cargo.toml`. +- use your own version of the dependency with the `[patch]` section in `Cargo.toml` For more information, see: https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section @@ -700,16 +700,16 @@ 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: -- Ensure the maintainers know of this problem (e.g. creating a bug report if needed) -or even helping with a fix (e.g. by creating a pull request): +- ensure the maintainers know of this problem (e.g. creating a bug report if needed) +or even helping with a fix (e.g. by creating a pull request) - bar@1.0.0 - - Repository: https://example.com/ - - Detailed warning command: `cargo report future-incompatibilities --id 1 --package bar@1.0.0` + - repository: https://example.com/ + - detailed warning command: `cargo report future-incompatibilities --id 1 --package bar@1.0.0` -- Use your own version of the dependency with the `[patch]` section in `Cargo.toml`. +- use your own version of the dependency with the `[patch]` section in `Cargo.toml` For more information, see: https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section @@ -723,16 +723,16 @@ 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: -- Ensure the maintainers know of this problem (e.g. creating a bug report if needed) -or even helping with a fix (e.g. by creating a pull request): +- ensure the maintainers know of this problem (e.g. creating a bug report if needed) +or even helping with a fix (e.g. by creating a pull request) - bar@1.0.0 - - Repository: https://example.com/ - - Detailed warning command: `cargo report future-incompatibilities --id 1 --package bar@1.0.0` + - repository: https://example.com/ + - detailed warning command: `cargo report future-incompatibilities --id 1 --package bar@1.0.0` -- Use your own version of the dependency with the `[patch]` section in `Cargo.toml`. +- use your own version of the dependency with the `[patch]` section in `Cargo.toml` For more information, see: https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section From 8e1cdcfb55f02a69638ccf78922588440ed64765 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 9 Sep 2025 20:42:22 -0500 Subject: [PATCH 10/11] fix(future): Remove gap between item and its children --- src/cargo/core/compiler/future_incompat.rs | 4 +--- tests/testsuite/future_incompat_report.rs | 8 -------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/cargo/core/compiler/future_incompat.rs b/src/cargo/core/compiler/future_incompat.rs index 5e87e9945f0..c2603f361e9 100644 --- a/src/cargo/core/compiler/future_incompat.rs +++ b/src/cargo/core/compiler/future_incompat.rs @@ -434,8 +434,7 @@ pub fn save_and_display_report( let update_message = if !updated_versions.is_empty() { format!( "\ -update to a newer version to see if the issue has been fixed -{updated_versions}", +update to a newer version to see if the issue has been fixed{updated_versions}", updated_versions = updated_versions ) } else { @@ -476,7 +475,6 @@ update to a newer version to see if the issue has been fixed "\ ensure the maintainers know of this problem (e.g. creating a bug report if needed) or even helping with a fix (e.g. by creating a pull request) - {upstream_info}" )); suggestions.push( diff --git a/tests/testsuite/future_incompat_report.rs b/tests/testsuite/future_incompat_report.rs index cbab4f05e37..9e8f0a0fa15 100644 --- a/tests/testsuite/future_incompat_report.rs +++ b/tests/testsuite/future_incompat_report.rs @@ -150,7 +150,6 @@ fn incompat_in_dependency() { - ensure the maintainers know of this problem (e.g. creating a bug report if needed) or even helping with a fix (e.g. by creating a pull request) - - bar@1.0.0 - repository: https://example.com/ - detailed warning command: `cargo report future-incompatibilities --id 1 --package bar@1.0.0` @@ -180,7 +179,6 @@ to solve this problem, you can try the following approaches: - ensure the maintainers know of this problem (e.g. creating a bug report if needed) or even helping with a fix (e.g. by creating a pull request) - - bar@1.0.0 - repository: https://example.com/ - detailed warning command: `cargo report future-incompatibilities --id 1 --package bar@1.0.0` @@ -598,13 +596,11 @@ fn suggestions_for_updates() { [NOTE] to solve this problem, you can try the following approaches: - update to a newer version to see if the issue has been fixed - - big_update v1.0.0 has the following newer versions available: 2.0.0 - with_updates v1.0.0 has the following newer versions available: 1.0.1, 1.0.2, 3.0.1 - ensure the maintainers know of this problem (e.g. creating a bug report if needed) or even helping with a fix (e.g. by creating a pull request) - - big_update@1.0.0 - repository: - detailed warning command: `cargo report future-incompatibilities --id 1 --package big_update@1.0.0` @@ -641,13 +637,11 @@ means and how to resolve it. to solve this problem, you can try the following approaches: - update to a newer version to see if the issue has been fixed - - big_update v1.0.0 has the following newer versions available: 2.0.0 - with_updates v1.0.0 has the following newer versions available: 1.0.1, 1.0.2, 3.0.1 - ensure the maintainers know of this problem (e.g. creating a bug report if needed) or even helping with a fix (e.g. by creating a pull request) - - big_update@1.0.0 - repository: - detailed warning command: `cargo report future-incompatibilities --id 1 --package big_update@1.0.0` @@ -704,7 +698,6 @@ fn correct_report_id_when_cached() { - ensure the maintainers know of this problem (e.g. creating a bug report if needed) or even helping with a fix (e.g. by creating a pull request) - - bar@1.0.0 - repository: https://example.com/ - detailed warning command: `cargo report future-incompatibilities --id 1 --package bar@1.0.0` @@ -727,7 +720,6 @@ https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch - ensure the maintainers know of this problem (e.g. creating a bug report if needed) or even helping with a fix (e.g. by creating a pull request) - - bar@1.0.0 - repository: https://example.com/ - detailed warning command: `cargo report future-incompatibilities --id 1 --package bar@1.0.0` From 2c5b4dfca9725d3646170468f2cdab10276e5361 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 9 Sep 2025 17:14:55 -0500 Subject: [PATCH 11/11] fix(future): Report all content as a single Report --- src/cargo/core/compiler/future_incompat.rs | 18 ++-- tests/testsuite/future_incompat_report.rs | 107 +++++++++------------ 2 files changed, 55 insertions(+), 70 deletions(-) diff --git a/src/cargo/core/compiler/future_incompat.rs b/src/cargo/core/compiler/future_incompat.rs index c2603f361e9..0d6d59d5c08 100644 --- a/src/cargo/core/compiler/future_incompat.rs +++ b/src/cargo/core/compiler/future_incompat.rs @@ -505,27 +505,29 @@ https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch current_reports.save_report(bcx.ws, suggestion_message.clone(), rendered_report); if should_display_message || bcx.build_config.future_incompat_report { - drop(bcx.gctx.shell().warn(&format!( + use annotate_snippets::*; + let mut report = vec![Group::with_title(Level::WARNING.secondary_title(format!( "the following packages contain code that will be rejected by a future \ version of Rust: {}", package_vers.join(", ") - ))); + )))]; if bcx.build_config.future_incompat_report { - if !suggestion_message.is_empty() { - drop(bcx.gctx.shell().note(&suggestion_message)); + for suggestion in &suggestions { + report.push(Group::with_title(Level::HELP.secondary_title(suggestion))); } - drop(bcx.gctx.shell().note(&format!( + report.push(Group::with_title(Level::NOTE.secondary_title(format!( "this report can be shown with `cargo report \ future-incompatibilities --id {}`", saved_report_id - ))); + )))); } else if should_display_message { - drop(bcx.gctx.shell().note(&format!( + report.push(Group::with_title(Level::NOTE.secondary_title(format!( "to see what the problems were, use the option \ `--future-incompat-report`, or run `cargo report \ future-incompatibilities --id {}`", saved_report_id - ))); + )))); } + drop(bcx.gctx.shell().print_report(&report, false)) } } diff --git a/tests/testsuite/future_incompat_report.rs b/tests/testsuite/future_incompat_report.rs index 9e8f0a0fa15..a6de493e460 100644 --- a/tests/testsuite/future_incompat_report.rs +++ b/tests/testsuite/future_incompat_report.rs @@ -146,18 +146,14 @@ 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: - -- ensure the maintainers know of this problem (e.g. creating a bug report if needed) -or even helping with a fix (e.g. by creating a pull request) - - bar@1.0.0 - - repository: https://example.com/ - - detailed warning command: `cargo report future-incompatibilities --id 1 --package bar@1.0.0` - -- use your own version of the dependency with the `[patch]` section in `Cargo.toml` -For more information, see: -https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section - +[HELP] ensure the maintainers know of this problem (e.g. creating a bug report if needed) + or even helping with a fix (e.g. by creating a pull request) + - bar@1.0.0 + - repository: https://example.com/ + - detailed warning command: `cargo report future-incompatibilities --id 1 --package bar@1.0.0` +[HELP] use your own version of the dependency with the `[patch]` section in `Cargo.toml` + For more information, see: + https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section [NOTE] this report can be shown with `cargo report future-incompatibilities --id 1` "#]]) @@ -362,9 +358,9 @@ fn test_multi_crate() { ... [WARNING] the following packages contain code that will be rejected by a future version of Rust: first-dep v0.0.1, second-dep v0.0.2 ... - - first-dep@0.0.1 + - first-dep@0.0.1 ... - - second-dep@0.0.2 + - second-dep@0.0.2 ... ") .run(); @@ -593,30 +589,25 @@ 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: - -- update to a newer version to see if the issue has been fixed - - big_update v1.0.0 has the following newer versions available: 2.0.0 - - with_updates v1.0.0 has the following newer versions available: 1.0.1, 1.0.2, 3.0.1 - -- ensure the maintainers know of this problem (e.g. creating a bug report if needed) -or even helping with a fix (e.g. by creating a pull request) - - big_update@1.0.0 - - repository: - - detailed warning command: `cargo report future-incompatibilities --id 1 --package big_update@1.0.0` - - - with_updates@1.0.0 - - repository: - - detailed warning command: `cargo report future-incompatibilities --id 1 --package with_updates@1.0.0` - - - without_updates@1.0.0 - - repository: - - detailed warning command: `cargo report future-incompatibilities --id 1 --package without_updates@1.0.0` - -- use your own version of the dependency with the `[patch]` section in `Cargo.toml` -For more information, see: -https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section - +[HELP] update to a newer version to see if the issue has been fixed + - big_update v1.0.0 has the following newer versions available: 2.0.0 + - with_updates v1.0.0 has the following newer versions available: 1.0.1, 1.0.2, 3.0.1 +[HELP] ensure the maintainers know of this problem (e.g. creating a bug report if needed) + or even helping with a fix (e.g. by creating a pull request) + - big_update@1.0.0 + - repository: + - detailed warning command: `cargo report future-incompatibilities --id 1 --package big_update@1.0.0` + + - with_updates@1.0.0 + - repository: + - detailed warning command: `cargo report future-incompatibilities --id 1 --package with_updates@1.0.0` + + - without_updates@1.0.0 + - repository: + - detailed warning command: `cargo report future-incompatibilities --id 1 --package without_updates@1.0.0` +[HELP] use your own version of the dependency with the `[patch]` section in `Cargo.toml` + For more information, see: + https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section [NOTE] this report can be shown with `cargo report future-incompatibilities --id 1` "#]]) @@ -694,18 +685,14 @@ 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: - -- ensure the maintainers know of this problem (e.g. creating a bug report if needed) -or even helping with a fix (e.g. by creating a pull request) - - bar@1.0.0 - - repository: https://example.com/ - - detailed warning command: `cargo report future-incompatibilities --id 1 --package bar@1.0.0` - -- use your own version of the dependency with the `[patch]` section in `Cargo.toml` -For more information, see: -https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section - +[HELP] ensure the maintainers know of this problem (e.g. creating a bug report if needed) + or even helping with a fix (e.g. by creating a pull request) + - bar@1.0.0 + - repository: https://example.com/ + - detailed warning command: `cargo report future-incompatibilities --id 1 --package bar@1.0.0` +[HELP] use your own version of the dependency with the `[patch]` section in `Cargo.toml` + For more information, see: + https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section [NOTE] this report can be shown with `cargo report future-incompatibilities --id 1` "#]]) @@ -716,18 +703,14 @@ 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: - -- ensure the maintainers know of this problem (e.g. creating a bug report if needed) -or even helping with a fix (e.g. by creating a pull request) - - bar@1.0.0 - - repository: https://example.com/ - - detailed warning command: `cargo report future-incompatibilities --id 1 --package bar@1.0.0` - -- use your own version of the dependency with the `[patch]` section in `Cargo.toml` -For more information, see: -https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section - +[HELP] ensure the maintainers know of this problem (e.g. creating a bug report if needed) + or even helping with a fix (e.g. by creating a pull request) + - bar@1.0.0 + - repository: https://example.com/ + - detailed warning command: `cargo report future-incompatibilities --id 1 --package bar@1.0.0` +[HELP] use your own version of the dependency with the `[patch]` section in `Cargo.toml` + For more information, see: + https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section [NOTE] this report can be shown with `cargo report future-incompatibilities --id 1` "#]])