mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
fix(future): Report all content as a single Report
This commit is contained in:
parent
8e1cdcfb55
commit
2c5b4dfca9
@ -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);
|
current_reports.save_report(bcx.ws, suggestion_message.clone(), rendered_report);
|
||||||
|
|
||||||
if should_display_message || bcx.build_config.future_incompat_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 \
|
"the following packages contain code that will be rejected by a future \
|
||||||
version of Rust: {}",
|
version of Rust: {}",
|
||||||
package_vers.join(", ")
|
package_vers.join(", ")
|
||||||
)));
|
)))];
|
||||||
if bcx.build_config.future_incompat_report {
|
if bcx.build_config.future_incompat_report {
|
||||||
if !suggestion_message.is_empty() {
|
for suggestion in &suggestions {
|
||||||
drop(bcx.gctx.shell().note(&suggestion_message));
|
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 \
|
"this report can be shown with `cargo report \
|
||||||
future-incompatibilities --id {}`",
|
future-incompatibilities --id {}`",
|
||||||
saved_report_id
|
saved_report_id
|
||||||
)));
|
))));
|
||||||
} else if should_display_message {
|
} 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 \
|
"to see what the problems were, use the option \
|
||||||
`--future-incompat-report`, or run `cargo report \
|
`--future-incompat-report`, or run `cargo report \
|
||||||
future-incompatibilities --id {}`",
|
future-incompatibilities --id {}`",
|
||||||
saved_report_id
|
saved_report_id
|
||||||
)));
|
))));
|
||||||
}
|
}
|
||||||
|
drop(bcx.gctx.shell().print_report(&report, false))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,18 +146,14 @@ fn incompat_in_dependency() {
|
|||||||
.with_stderr_data(str![[r#"
|
.with_stderr_data(str![[r#"
|
||||||
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
|
[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
|
[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:
|
[HELP] ensure the maintainers know of this problem (e.g. creating a bug report if needed)
|
||||||
|
|
||||||
- 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)
|
or even helping with a fix (e.g. by creating a pull request)
|
||||||
- bar@1.0.0
|
- bar@1.0.0
|
||||||
- repository: https://example.com/
|
- repository: https://example.com/
|
||||||
- detailed warning command: `cargo report future-incompatibilities --id 1 --package bar@1.0.0`
|
- 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`
|
||||||
- use your own version of the dependency with the `[patch]` section in `Cargo.toml`
|
|
||||||
For more information, see:
|
For more information, see:
|
||||||
https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section
|
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`
|
[NOTE] this report can be shown with `cargo report future-incompatibilities --id 1`
|
||||||
|
|
||||||
"#]])
|
"#]])
|
||||||
@ -593,13 +589,10 @@ fn suggestions_for_updates() {
|
|||||||
[CHECKING] foo v0.1.0 ([ROOT]/foo)
|
[CHECKING] foo v0.1.0 ([ROOT]/foo)
|
||||||
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
|
[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
|
[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:
|
[HELP] 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
|
- 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
|
- 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)
|
||||||
- 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)
|
or even helping with a fix (e.g. by creating a pull request)
|
||||||
- big_update@1.0.0
|
- big_update@1.0.0
|
||||||
- repository: <not found>
|
- repository: <not found>
|
||||||
@ -612,11 +605,9 @@ or even helping with a fix (e.g. by creating a pull request)
|
|||||||
- without_updates@1.0.0
|
- without_updates@1.0.0
|
||||||
- repository: <not found>
|
- repository: <not found>
|
||||||
- detailed warning command: `cargo report future-incompatibilities --id 1 --package without_updates@1.0.0`
|
- 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`
|
||||||
- use your own version of the dependency with the `[patch]` section in `Cargo.toml`
|
|
||||||
For more information, see:
|
For more information, see:
|
||||||
https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section
|
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`
|
[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)
|
[CHECKING] foo v1.0.0 ([ROOT]/foo)
|
||||||
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
|
[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
|
[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:
|
[HELP] ensure the maintainers know of this problem (e.g. creating a bug report if needed)
|
||||||
|
|
||||||
- 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)
|
or even helping with a fix (e.g. by creating a pull request)
|
||||||
- bar@1.0.0
|
- bar@1.0.0
|
||||||
- repository: https://example.com/
|
- repository: https://example.com/
|
||||||
- detailed warning command: `cargo report future-incompatibilities --id 1 --package bar@1.0.0`
|
- 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`
|
||||||
- use your own version of the dependency with the `[patch]` section in `Cargo.toml`
|
|
||||||
For more information, see:
|
For more information, see:
|
||||||
https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section
|
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`
|
[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#"
|
.with_stderr_data(str![[r#"
|
||||||
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
|
[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
|
[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:
|
[HELP] ensure the maintainers know of this problem (e.g. creating a bug report if needed)
|
||||||
|
|
||||||
- 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)
|
or even helping with a fix (e.g. by creating a pull request)
|
||||||
- bar@1.0.0
|
- bar@1.0.0
|
||||||
- repository: https://example.com/
|
- repository: https://example.com/
|
||||||
- detailed warning command: `cargo report future-incompatibilities --id 1 --package bar@1.0.0`
|
- 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`
|
||||||
- use your own version of the dependency with the `[patch]` section in `Cargo.toml`
|
|
||||||
For more information, see:
|
For more information, see:
|
||||||
https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section
|
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`
|
[NOTE] this report can be shown with `cargo report future-incompatibilities --id 1`
|
||||||
|
|
||||||
"#]])
|
"#]])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user