]> git.proxmox.com Git - cargo.git/commit
Combine rustc and cargo's diagnostic summaries
authorJoshua Nelson <jyn514@gmail.com>
Mon, 5 Jul 2021 21:32:40 +0000 (17:32 -0400)
committerJoshua Nelson <jyn514@gmail.com>
Tue, 6 Jul 2021 23:46:27 +0000 (19:46 -0400)
commit9c7cc545d738ca1e4eb04e8f2d5c3b224bf548d3
tree62c640e02d87d661fc9aae72b89617cda84b19a5
parent768b5658c256fecbb80436364f72f91c49bdc645
Combine rustc and cargo's diagnostic summaries

This works by introspecting rustc's error output, using the JSON format
to determine whether it's a warning or error, then skipping it
altogether if it's a summary of the diagnostics printed.

Before:

```
src/main.rs:1:10: warning: trait objects without an explicit `dyn` are deprecated
src/main.rs:1:1: error[E0601]: `main` function not found in crate `wrong`
src/main.rs:1:9: error[E0038]: the trait `Clone` cannot be made into an object
error: aborting due to 2 previous errors; 1 warning emitted
error: could not compile `wrong`

```

After:

```
$ cargo check --message-format short
src/main.rs:1:10: warning: trait objects without an explicit `dyn` are deprecated
src/main.rs:1:1: error[E0601]: `main` function not found in crate `wrong`
src/main.rs:1:9: error[E0038]: the trait `Clone` cannot be made into an object
error: could not compile `wrong` due to 2 previous errors; 1 warning emitted
```
src/cargo/core/compiler/future_incompat.rs
src/cargo/core/compiler/mod.rs
tests/testsuite/build.rs
tests/testsuite/build_script.rs
tests/testsuite/check.rs
tests/testsuite/fix.rs
tests/testsuite/install.rs