Skip to content

Commit b17b9a4

Browse files
committed
Elaborate the full output when there are newer versions available
This output was never tested.
1 parent 4d961ed commit b17b9a4

File tree

1 file changed

+91
-4
lines changed

1 file changed

+91
-4
lines changed

tests/testsuite/future_incompat_report.rs

Lines changed: 91 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,7 @@ fn suggestions_for_updates() {
553553
[package]
554554
name = "foo"
555555
version = "0.1.0"
556+
edition = "2015"
556557
557558
[dependencies]
558559
with_updates = "1"
@@ -591,25 +592,111 @@ fn suggestions_for_updates() {
591592
.masquerade_as_nightly_cargo(&["future-incompat-test"])
592593
.env("RUSTFLAGS", "-Zfuture-incompat-test")
593594
.with_stderr_data(str![[r#"
594-
...
595+
[DOWNLOADING] crates ...
596+
[DOWNLOADED] without_updates v1.0.0 (registry `dummy-registry`)
597+
[DOWNLOADED] with_updates v1.0.0 (registry `dummy-registry`)
598+
[DOWNLOADED] big_update v1.0.0 (registry `dummy-registry`)
599+
[CHECKING] with_updates v1.0.0
600+
[CHECKING] big_update v1.0.0
601+
[CHECKING] without_updates v1.0.0
602+
[CHECKING] foo v0.1.0 ([ROOT]/foo)
603+
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
604+
[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
605+
[NOTE]
606+
To solve this problem, you can try the following approaches:
607+
608+
595609
- Some affected dependencies have newer versions available.
596610
You may want to consider updating them to a newer version to see if the issue has been fixed.
597611
598612
big_update v1.0.0 has the following newer versions available: 2.0.0
599613
with_updates v1.0.0 has the following newer versions available: 1.0.1, 1.0.2, 3.0.1
600-
...
601-
"#]])
614+
615+
616+
- If the issue is not solved by updating the dependencies, a fix has to be
617+
implemented by those dependencies. You can help with that by notifying the
618+
maintainers of this problem (e.g. by creating a bug report) or by proposing a
619+
fix to the maintainers (e.g. by creating a pull request):
620+
621+
622+
- Repository: <not found>
623+
- Detailed warning command: `cargo report future-incompatibilities --id 1 --package [email protected]`
624+
625+
626+
- Repository: <not found>
627+
- Detailed warning command: `cargo report future-incompatibilities --id 1 --package [email protected]`
628+
629+
630+
- Repository: <not found>
631+
- Detailed warning command: `cargo report future-incompatibilities --id 1 --package [email protected]`
632+
633+
- If waiting for an upstream fix is not an option, you can use the `[patch]`
634+
section in `Cargo.toml` to use your own version of the dependency. For more
635+
information, see:
636+
https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section
637+
638+
[NOTE] this report can be shown with `cargo report future-incompatibilities --id 1`
639+
640+
"#]].unordered())
602641
.run();
603642

604643
p.cargo("report future-incompatibilities")
605644
.with_stdout_data(str![[r#"
606-
...
645+
The following warnings were discovered during the build. These warnings are an
646+
indication that the packages contain code that will become an error in a
647+
future release of Rust. These warnings typically cover changes to close
648+
soundness problems, unintended or undocumented behavior, or critical problems
649+
that cannot be fixed in a backwards-compatible fashion, and are not expected
650+
to be in wide use.
651+
652+
Each warning should contain a link for more information on what the warning
653+
means and how to resolve it.
654+
655+
656+
To solve this problem, you can try the following approaches:
657+
658+
607659
- Some affected dependencies have newer versions available.
608660
You may want to consider updating them to a newer version to see if the issue has been fixed.
609661
610662
big_update v1.0.0 has the following newer versions available: 2.0.0
611663
with_updates v1.0.0 has the following newer versions available: 1.0.1, 1.0.2, 3.0.1
664+
665+
666+
- If the issue is not solved by updating the dependencies, a fix has to be
667+
implemented by those dependencies. You can help with that by notifying the
668+
maintainers of this problem (e.g. by creating a bug report) or by proposing a
669+
fix to the maintainers (e.g. by creating a pull request):
670+
671+
672+
- Repository: <not found>
673+
- Detailed warning command: `cargo report future-incompatibilities --id 1 --package [email protected]`
674+
675+
676+
- Repository: <not found>
677+
- Detailed warning command: `cargo report future-incompatibilities --id 1 --package [email protected]`
678+
679+
680+
- Repository: <not found>
681+
- Detailed warning command: `cargo report future-incompatibilities --id 1 --package [email protected]`
682+
683+
- If waiting for an upstream fix is not an option, you can use the `[patch]`
684+
section in `Cargo.toml` to use your own version of the dependency. For more
685+
information, see:
686+
https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section
687+
688+
The package `big_update v1.0.0` currently triggers the following future incompatibility lints:
689+
> [WARNING] unused variable: `x`
690+
...
691+
692+
The package `with_updates v1.0.0` currently triggers the following future incompatibility lints:
693+
> [WARNING] unused variable: `x`
612694
...
695+
696+
The package `without_updates v1.0.0` currently triggers the following future incompatibility lints:
697+
> [WARNING] unused variable: `x`
698+
...
699+
613700
"#]])
614701
.run();
615702
}

0 commit comments

Comments
 (0)