-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ICE in diagnostic_hir_wf_check
#87524
Conversation
@FabianWolff: I think a better solution would be to add support for |
Fixed. Thanks for the quick review! |
Thanks! |
📌 Commit dbd0fd2 has been approved by |
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`
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
Fixes #87495. The documentation for
ObligationCauseCode::WellFormed
says thatinstead of
WellFormed(Some(...))
, which seems to have caused the issue here, asdiagnostic_hir_wf_check
does 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