Uh oh!
There was an error while loading. Please reload this page.
Fix ICE when a future-incompat-report has its command-line level capped - #78663
Conversation
Fixesrust-lang#78660 With PR rust-lang#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).
| LL | ["hi"].into_iter(); | ||
| | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` | ||
| | | ||
| = note: `-D array-into-iter` implied by `-D warnings` |
There was a problem hiding this comment.
We should suppress this message when a lint only shows up in the future incompat report. However, this only affects nightly, so I'll address it in a follow up PR.
JohnTitor
commented
Nov 2, 2020
| Level::Deny => "-D", | ||
| Level::Forbid => "-F", | ||
| Level::Allow => panic!(), | ||
| Level::Allow => "-A", |
There was a problem hiding this comment.
This would still be unexpected, no?
(feel free to ignore if I'm wrong or this is otherwise intentional)
There was a problem hiding this comment.
You can pass -A warnings on the command line. Previously, we would never show a specific help message, since we would bail out when the lint is allowed. Now, we may emit a future-incompat report, where we will want to specify the command-line flag.
tmandry
commented
Nov 3, 2020
r? @tmandry Looks good, r=me after comment |
Aaron1011
commented
Nov 3, 2020
@bors r=tmandry |
bors
commented
Nov 3, 2020
📌 Commit 6c1f15f has been approved by |
Rollup of 8 pull requests Successful merges: - rust-lang#78376 (Treat trailing semicolon as a statement in macro call) - rust-lang#78400 (Fix unindent in doc comments) - rust-lang#78575 (Add a test for compiletest rustc-env & unset-rustc-env directives) - rust-lang#78616 (Document -Zinstrument-coverage) - rust-lang#78663 (Fix ICE when a future-incompat-report has its command-line level capped) - rust-lang#78664 (Fix intrinsic size_of stable link) - rust-lang#78668 (inliner: Remove redundant loop) - rust-lang#78676 (add mipsel-unknown-none target) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fixes#78660
With PR #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-lintsis applied. This is used to emit a more precise errornote (e.g. we don't say that
-W lint-namewas specified on thecommand line just because a lint was capped to Warn). As a result, we
can now correctly emit a note that
-Awas used if we gotLevel::Allowfrom the command line (before the cap is applied).