Skip to content

Commit ec9af1f

Browse files
committed
fix(future): Lead with the suggested action
1 parent 15ca370 commit ec9af1f

File tree

2 files changed

+31
-55
lines changed

2 files changed

+31
-55
lines changed

src/cargo/core/compiler/future_incompat.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,7 @@ pub fn save_and_display_report(
434434
let update_message = if !updated_versions.is_empty() {
435435
format!(
436436
"\
437-
Some affected dependencies have newer versions available.
438-
You may want to consider updating them to a newer version to see if the issue has been fixed.
437+
Update to a newer version to see if the issue has been fixed:
439438
{updated_versions}",
440439
updated_versions = updated_versions
441440
)
@@ -475,18 +474,15 @@ You may want to consider updating them to a newer version to see if the issue ha
475474
}
476475
suggestions.push(format!(
477476
"\
478-
If the issue is not solved by updating the dependencies, a fix has to be
479-
implemented by those dependencies. You can help with that by notifying the
480-
maintainers of this problem (e.g. by creating a bug report) or by proposing a
481-
fix to the maintainers (e.g. by creating a pull request):
477+
Ensure the maintainers know of this problem (e.g. creating a bug report if needed)
478+
or even helping with a fix (e.g. by creating a pull request):
482479
483480
{upstream_info}"
484481
));
485482
suggestions.push(
486483
"\
487-
If waiting for an upstream fix is not an option, you can use the `[patch]`
488-
section in `Cargo.toml` to use your own version of the dependency. For more
489-
information, see:
484+
Use your own version of the dependency with the `[patch]` section in `Cargo.toml`.
485+
For more information, see:
490486
https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section"
491487
.to_owned(),
492488
);

tests/testsuite/future_incompat_report.rs

Lines changed: 26 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -148,18 +148,15 @@ fn incompat_in_dependency() {
148148
[WARNING] the following packages contain code that will be rejected by a future version of Rust: bar v1.0.0
149149
[NOTE] To solve this problem, you can try the following approaches:
150150
151-
- If the issue is not solved by updating the dependencies, a fix has to be
152-
implemented by those dependencies. You can help with that by notifying the
153-
maintainers of this problem (e.g. by creating a bug report) or by proposing a
154-
fix to the maintainers (e.g. by creating a pull request):
151+
- Ensure the maintainers know of this problem (e.g. creating a bug report if needed)
152+
or even helping with a fix (e.g. by creating a pull request):
155153
156154
157155
- Repository: https://example.com/
158156
- Detailed warning command: `cargo report future-incompatibilities --id 1 --package [email protected]`
159157
160-
- If waiting for an upstream fix is not an option, you can use the `[patch]`
161-
section in `Cargo.toml` to use your own version of the dependency. For more
162-
information, see:
158+
- Use your own version of the dependency with the `[patch]` section in `Cargo.toml`.
159+
For more information, see:
163160
https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section
164161
165162
[NOTE] this report can be shown with `cargo report future-incompatibilities --id 1`
@@ -181,18 +178,15 @@ means and how to resolve it.
181178
182179
To solve this problem, you can try the following approaches:
183180
184-
- If the issue is not solved by updating the dependencies, a fix has to be
185-
implemented by those dependencies. You can help with that by notifying the
186-
maintainers of this problem (e.g. by creating a bug report) or by proposing a
187-
fix to the maintainers (e.g. by creating a pull request):
181+
- Ensure the maintainers know of this problem (e.g. creating a bug report if needed)
182+
or even helping with a fix (e.g. by creating a pull request):
188183
189184
190185
- Repository: https://example.com/
191186
- Detailed warning command: `cargo report future-incompatibilities --id 1 --package [email protected]`
192187
193-
- If waiting for an upstream fix is not an option, you can use the `[patch]`
194-
section in `Cargo.toml` to use your own version of the dependency. For more
195-
information, see:
188+
- Use your own version of the dependency with the `[patch]` section in `Cargo.toml`.
189+
For more information, see:
196190
https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section
197191
198192
The package `bar v1.0.0` currently triggers the following future incompatibility lints:
@@ -603,16 +597,13 @@ fn suggestions_for_updates() {
603597
[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
604598
[NOTE] To solve this problem, you can try the following approaches:
605599
606-
- Some affected dependencies have newer versions available.
607-
You may want to consider updating them to a newer version to see if the issue has been fixed.
600+
- Update to a newer version to see if the issue has been fixed:
608601
609602
- big_update v1.0.0 has the following newer versions available: 2.0.0
610603
- with_updates v1.0.0 has the following newer versions available: 1.0.1, 1.0.2, 3.0.1
611604
612-
- If the issue is not solved by updating the dependencies, a fix has to be
613-
implemented by those dependencies. You can help with that by notifying the
614-
maintainers of this problem (e.g. by creating a bug report) or by proposing a
615-
fix to the maintainers (e.g. by creating a pull request):
605+
- Ensure the maintainers know of this problem (e.g. creating a bug report if needed)
606+
or even helping with a fix (e.g. by creating a pull request):
616607
617608
618609
- Repository: <not found>
@@ -626,9 +617,8 @@ fix to the maintainers (e.g. by creating a pull request):
626617
- Repository: <not found>
627618
- Detailed warning command: `cargo report future-incompatibilities --id 1 --package [email protected]`
628619
629-
- If waiting for an upstream fix is not an option, you can use the `[patch]`
630-
section in `Cargo.toml` to use your own version of the dependency. For more
631-
information, see:
620+
- Use your own version of the dependency with the `[patch]` section in `Cargo.toml`.
621+
For more information, see:
632622
https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section
633623
634624
[NOTE] this report can be shown with `cargo report future-incompatibilities --id 1`
@@ -650,16 +640,13 @@ means and how to resolve it.
650640
651641
To solve this problem, you can try the following approaches:
652642
653-
- Some affected dependencies have newer versions available.
654-
You may want to consider updating them to a newer version to see if the issue has been fixed.
643+
- Update to a newer version to see if the issue has been fixed:
655644
656645
- big_update v1.0.0 has the following newer versions available: 2.0.0
657646
- with_updates v1.0.0 has the following newer versions available: 1.0.1, 1.0.2, 3.0.1
658647
659-
- If the issue is not solved by updating the dependencies, a fix has to be
660-
implemented by those dependencies. You can help with that by notifying the
661-
maintainers of this problem (e.g. by creating a bug report) or by proposing a
662-
fix to the maintainers (e.g. by creating a pull request):
648+
- Ensure the maintainers know of this problem (e.g. creating a bug report if needed)
649+
or even helping with a fix (e.g. by creating a pull request):
663650
664651
665652
- Repository: <not found>
@@ -673,9 +660,8 @@ fix to the maintainers (e.g. by creating a pull request):
673660
- Repository: <not found>
674661
- Detailed warning command: `cargo report future-incompatibilities --id 1 --package [email protected]`
675662
676-
- If waiting for an upstream fix is not an option, you can use the `[patch]`
677-
section in `Cargo.toml` to use your own version of the dependency. For more
678-
information, see:
663+
- Use your own version of the dependency with the `[patch]` section in `Cargo.toml`.
664+
For more information, see:
679665
https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section
680666
681667
The package `big_update v1.0.0` currently triggers the following future incompatibility lints:
@@ -716,18 +702,15 @@ fn correct_report_id_when_cached() {
716702
[WARNING] the following packages contain code that will be rejected by a future version of Rust: bar v1.0.0
717703
[NOTE] To solve this problem, you can try the following approaches:
718704
719-
- If the issue is not solved by updating the dependencies, a fix has to be
720-
implemented by those dependencies. You can help with that by notifying the
721-
maintainers of this problem (e.g. by creating a bug report) or by proposing a
722-
fix to the maintainers (e.g. by creating a pull request):
705+
- Ensure the maintainers know of this problem (e.g. creating a bug report if needed)
706+
or even helping with a fix (e.g. by creating a pull request):
723707
724708
725709
- Repository: https://example.com/
726710
- Detailed warning command: `cargo report future-incompatibilities --id 1 --package [email protected]`
727711
728-
- If waiting for an upstream fix is not an option, you can use the `[patch]`
729-
section in `Cargo.toml` to use your own version of the dependency. For more
730-
information, see:
712+
- Use your own version of the dependency with the `[patch]` section in `Cargo.toml`.
713+
For more information, see:
731714
https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section
732715
733716
[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
742725
[WARNING] the following packages contain code that will be rejected by a future version of Rust: bar v1.0.0
743726
[NOTE] To solve this problem, you can try the following approaches:
744727
745-
- If the issue is not solved by updating the dependencies, a fix has to be
746-
implemented by those dependencies. You can help with that by notifying the
747-
maintainers of this problem (e.g. by creating a bug report) or by proposing a
748-
fix to the maintainers (e.g. by creating a pull request):
728+
- Ensure the maintainers know of this problem (e.g. creating a bug report if needed)
729+
or even helping with a fix (e.g. by creating a pull request):
749730
750731
751732
- Repository: https://example.com/
752733
- Detailed warning command: `cargo report future-incompatibilities --id 1 --package [email protected]`
753734
754-
- If waiting for an upstream fix is not an option, you can use the `[patch]`
755-
section in `Cargo.toml` to use your own version of the dependency. For more
756-
information, see:
735+
- Use your own version of the dependency with the `[patch]` section in `Cargo.toml`.
736+
For more information, see:
757737
https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section
758738
759739
[NOTE] this report can be shown with `cargo report future-incompatibilities --id 1`

0 commit comments

Comments
 (0)