]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #78663 - Aaron1011:fix/cap-future-compat, r=tmandry
authorYuki Okushi <huyuumi.dev@gmail.com>
Tue, 3 Nov 2020 06:27:16 +0000 (15:27 +0900)
committerGitHub <noreply@github.com>
Tue, 3 Nov 2020 06:27:16 +0000 (15:27 +0900)
Fix ICE when a future-incompat-report has its command-line level capped

Fixes #78660

With PR https://github.com/rust-lang/rust/pull/75534 merged, we now run
more lint-related code for future-incompat-report, even when their final
level is Allow. Some lint-related code was not expecting `Level::Allow`,
and had an explicit panic.

This PR explicitly tracks the lint level set on the command line before
`--cap-lints` is applied. This is used to emit a more precise error
note (e.g. we don't say that `-W lint-name` was specified on the
command line just because a lint was capped to Warn). As a result, we
can now correctly emit a note that `-A` was used if we got
`Level::Allow` from the command line (before the cap is applied).


Trivial merge