]> git.proxmox.com Git - cargo.git/commitdiff
Auto merge of #9675 - ehuss:diagnostic-dedupe, r=alexcrichton
authorbors <bors@rust-lang.org>
Fri, 16 Jul 2021 15:22:58 +0000 (15:22 +0000)
committerbors <bors@rust-lang.org>
Fri, 16 Jul 2021 15:22:58 +0000 (15:22 +0000)
Deduplicate compiler diagnostics.

This adds some logic to deduplicate diagnostics emitted across rustc invocations. There are some situations where different targets can emit the same message, and that has caused confusion particularly for new users. A prominent example is running `cargo test` which will build the library twice concurrently (once as a normal library, and once as a test).

As part of this, the "N warnings emitted" message sent by rustc is intercepted, and instead cargo generates its own summary. This is to prevent potentially confusing situations where that message is either deduplicated, or wrong. It also provides a little more context to explain exactly *what* issued the warnings.  Example:

```warning: `foo` (lib) generated 1 warning```

This only impacts human-readable output, it does not change JSON behavior.

Closes #9104


Trivial merge