Fix ICE in diagnostic_hir_wf_check#87524
Merged
bors merged 1 commit intorust-lang:masterfrom Jul 28, 2021
Merged
Conversation
Contributor
|
@FabianWolff: I think a better solution would be to add support for |
Contributor
Author
Fixed. Thanks for the quick review! |
Aaron1011
reviewed
Jul 27, 2021
Aaron1011
reviewed
Jul 27, 2021
Contributor
|
Thanks! |
Collaborator
|
📌 Commit dbd0fd2 has been approved by |
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this pull request
Jul 28, 2021
Fix ICE in `diagnostic_hir_wf_check` Fixes rust-lang#87495. The [documentation for `ObligationCauseCode::WellFormed`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/traits/enum.ObligationCauseCode.html#variant.WellFormed) says that > it is always correct [...] to specify `WellFormed(None)` instead of `WellFormed(Some(...))`, which seems to have caused the issue here, as `diagnostic_hir_wf_check` does not expect to be called with an associated constant and will ICE: https://github.com/rust-lang/rust/blob/fd853c00e255559255885aadff9e93a1760c8728/compiler/rustc_typeck/src/hir_wf_check.rs#L131-L134 Therefore, I have changed `check_associated_item()` to pass a `WellFormed(None)` for associated constants. r? `@Aaron1011`
This was referenced Jul 28, 2021
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 28, 2021
Rollup of 10 pull requests Successful merges: - rust-lang#87315 (Add docs for raw-dylib to unstable book) - rust-lang#87330 (Use hashbrown's `extend_reserve()` in `HashMap`) - rust-lang#87443 (Don't treat git repos as non-existent when `ignore_git` is set) - rust-lang#87453 (Suggest removing unnecessary &mut as help message) - rust-lang#87500 (Document math behind MIN/MAX consts on integers) - rust-lang#87501 (Remove min_type_alias_impl_trait in favor of type_alias_impl_trait) - rust-lang#87507 (SGX mutex is *not* moveable) - rust-lang#87513 (bootstrap.py: change `git log` option to indicate desired behavior) - rust-lang#87523 (Stop creating a reference then immediately dereferencing it.) - rust-lang#87524 (Fix ICE in `diagnostic_hir_wf_check`) 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 #87495. The documentation for
ObligationCauseCode::WellFormedsays thatinstead of
WellFormed(Some(...)), which seems to have caused the issue here, asdiagnostic_hir_wf_checkdoes not expect to be called with an associated constant and will ICE:rust/compiler/rustc_typeck/src/hir_wf_check.rs
Lines 131 to 134 in fd853c0
Therefore, I have changed
check_associated_item()to pass aWellFormed(None)for associated constants.r? @Aaron1011