Fix ICE when a future-incompat-report has its command-line level capped#78663
Merged
bors merged 1 commit intorust-lang:masterfrom Nov 3, 2020
Merged
Fix ICE when a future-incompat-report has its command-line level capped#78663bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
Fixes rust-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).
Aaron1011
commented
Nov 2, 2020
| LL | ["hi"].into_iter(); | ||
| | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter` | ||
| | | ||
| = note: `-D array-into-iter` implied by `-D warnings` |
Contributor
Author
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.
Member
tmandry
reviewed
Nov 3, 2020
| Level::Deny => "-D", | ||
| Level::Forbid => "-F", | ||
| Level::Allow => panic!(), | ||
| Level::Allow => "-A", |
Member
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)
Contributor
Author
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.
Member
|
r? @tmandry Looks good, r=me after comment |
Contributor
Author
|
@bors r=tmandry |
Collaborator
|
📌 Commit 6c1f15f has been approved by |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Nov 3, 2020
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).