mirror of
https://github.com/rust-lang/cargo
synced 2024-10-29 04:24:18 +00:00
Auto merge of #9263 - Aaron1011:zero-incompat-note, r=ehuss
Emit note when `--future-incompat-report` had nothing to report
This commit is contained in:
commit
58a9613144
2 changed files with 27 additions and 3 deletions
|
@ -808,9 +808,16 @@ impl<'cfg> DrainState<'cfg> {
|
|||
}
|
||||
|
||||
fn emit_future_incompat(&mut self, cx: &mut Context<'_, '_>) {
|
||||
if cx.bcx.config.cli_unstable().enable_future_incompat_feature
|
||||
&& !self.per_crate_future_incompat_reports.is_empty()
|
||||
{
|
||||
if cx.bcx.config.cli_unstable().enable_future_incompat_feature {
|
||||
if self.per_crate_future_incompat_reports.is_empty() {
|
||||
drop(
|
||||
cx.bcx
|
||||
.config
|
||||
.shell()
|
||||
.note("0 dependencies had future-incompat warnings"),
|
||||
);
|
||||
return;
|
||||
}
|
||||
self.per_crate_future_incompat_reports
|
||||
.sort_by_key(|r| r.package_id);
|
||||
|
||||
|
|
|
@ -51,6 +51,23 @@ fn gate_future_incompat_report() {
|
|||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn test_zero_future_incompat() {
|
||||
if !is_nightly() {
|
||||
return;
|
||||
}
|
||||
|
||||
let p = project()
|
||||
.file("Cargo.toml", &basic_manifest("foo", "0.0.0"))
|
||||
.file("src/main.rs", "fn main() {}")
|
||||
.build();
|
||||
|
||||
p.cargo("build --future-incompat-report -Z unstable-options -Z future-incompat-report")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.with_stderr_contains("note: 0 dependencies had future-incompat warnings")
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn test_single_crate() {
|
||||
if !is_nightly() {
|
||||
|
|
Loading…
Reference in a new issue