14 Commits

Author SHA1 Message Date
Eric Huss
e7df0d136c Temporarily disable future_incompat tests. 2021-06-29 11:56:03 -07:00
Eric Huss
afe7314ede Don't trigger an update when looking for suggestions. 2021-06-21 09:55:29 -07:00
Eric Huss
a93bfcbdff Print reports using shell to handle old Windows colors properly. 2021-06-21 09:50:42 -07:00
Eric Huss
71cb59b6ef Future-incompat report: Add suggestions of newer versions. 2021-06-21 09:49:43 -07:00
Eric Huss
1f7141f892 Add future-incompat as an alias for future-incompatibilities. 2021-06-21 09:49:43 -07:00
Eric Huss
c2b02b3926 Updates to future-incompatible reporting. 2021-06-21 09:49:41 -07:00
Eric Huss
ff49b829e6 Add report subcommand. 2021-04-30 13:01:21 -07:00
Matthias Krüger
1b7fa21f39 fix clippy warnings
fixes these clippy warnings:

map_collect_result_unit
needless_borrow
needless_return
into_iter_on_ref
manual_flatten
match_like_matches_macro
bool_comparison
2021-04-02 12:30:36 +02:00
bors
58a9613144 Auto merge of #9263 - Aaron1011:zero-incompat-note, r=ehuss
Emit note when `--future-incompat-report` had nothing to report
2021-03-22 22:59:56 +00:00
Aaron Hill
f9512ff822
Emit note when --future-incompat-report had nothing to report 2021-03-14 23:22:51 -04:00
Aaron Hill
63ed725fd8
Add --future-incompat-report support to cargo test
This was missed in the original PR
2021-03-14 15:50:01 -04:00
Eric Huss
9ea3503680 Fix some minor formatting issues. 2021-03-05 14:01:01 -08:00
Aaron Hill
f03d47ce4b
Address review comments 2021-03-04 15:21:16 -05:00
Aaron Hill
6177c6584b
Implement future incompatibility report support
cc rust-lang/rust#71249

This implements the Cargo side of 'Cargo report future-incompat'

Based on feedback from alexcrichton and est31, I'm implemented this a
flag `--future-compat-report` on `cargo check/build/rustc`, rather than
a separate `cargo describe-future-incompatibilities` command. This
allows us to avoid writing additional information to disk (beyond the
pre-existing recording of rustc command outputs).

This PR contains:

* Gating of all functionality behind `-Z report-future-incompat`.
  Without this flag, all user output is unchanged.
* Passing `-Z emit-future-incompat-report` to rustc when
  `-Z report-future-incompat` is enabled
* Parsing the rustc JSON future incompat report, and displaying it
  it a user-readable format.
* Emitting a warning at the end of a build if any crates had
  future-incompat reports
* A `--future-incompat-report` flag, which shows the full report for
  each affected crate.
* Tests for all of the above.

At the moment, we can use the `array_into_iter` to write a test.
However, we might eventually get to a point where rustc is not currently
emitting future-incompat reports for any lints. What would we want the
cargo tests to do in this situation?

This functionality didn't require any significant internal changes to
Cargo, with one exception: we now process captured command output for
all units, not just ones where we want to display warnings. This may
result in a slightly longer time to run `cargo build/check/rustc` from
a full cache. since we do slightly more work for each upstream
dependency. Doing this seems unavoidable with the current architecture,
since we need to process captured command outputs to detect
any future-incompat-report messages that were emitted.
2021-03-04 15:21:15 -05:00